Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

NOISSUE - Add TTL option#15

Merged
dborovcanin merged 4 commits into
absmach:mainfrom
nyagamunene:add-ttl-option
Sep 11, 2024
Merged

NOISSUE - Add TTL option#15
dborovcanin merged 4 commits into
absmach:mainfrom
nyagamunene:add-ttl-option

Conversation

@nyagamunene

Copy link
Copy Markdown
Contributor

What type of PR is this?

This is a feature because it adds the following functionality: it add time to live as an option when issuing certs.

What does this do?

It introduces the option to change time duration of a certificate to live.

Which issue(s) does this PR fix/relate to?

N/A

Have you included tests for your changes?

Yes

Did you document any new/modified features?

No, will be done in a different PR.

Notes

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
@nyagamunene nyagamunene marked this pull request as ready for review September 11, 2024 09:06
Comment thread service.go
Comment on lines +94 to +102
var validity time.Duration
if ttl != "" {
validity, err = time.ParseDuration(ttl)
if err != nil {
return "", errors.Wrap(ErrMalformedEntity, err)
}
} else {
validity = certValidityPeriod
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use full stop in the comment and update to something like:

Suggested change
var validity time.Duration
if ttl != "" {
validity, err = time.ParseDuration(ttl)
if err != nil {
return "", errors.Wrap(ErrMalformedEntity, err)
}
} else {
validity = certValidityPeriod
}
// Parse the TTL if provided, otherwise use the default certValidityPeriod.
validity := certValidityPeriod
if ttl != "" {
if validity, err = time.ParseDuration(ttl); err != nil {
return "", errors.Wrap(ErrMalformedEntity, err)
}
}

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
@dborovcanin dborovcanin merged commit 8e26408 into absmach:main Sep 11, 2024
@nyagamunene nyagamunene self-assigned this Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants