Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add localauthority jwt prepare server command #5418

Merged

Conversation

amartinezfayo
Copy link
Member

Add localauthority jwt prepare server command.

Signed-off-by: Agustín Martínez Fayó <[email protected]>
Copy link
Collaborator

@MarcosDY MarcosDY left a comment

Choose a reason for hiding this comment

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

LGTM: a minor NIT that is up to you

Comment on lines +64 to +69
if r.PreparedAuthority != nil {
env.Printf(" Authority ID: %s\n", r.PreparedAuthority.AuthorityId)
env.Printf(" Expires at: %s\n", time.Unix(r.PreparedAuthority.ExpiresAt, 0).UTC())
} else {
return errors.New("internal error: expected to have prepared JWT authority information")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT:

Suggested change
if r.PreparedAuthority != nil {
env.Printf(" Authority ID: %s\n", r.PreparedAuthority.AuthorityId)
env.Printf(" Expires at: %s\n", time.Unix(r.PreparedAuthority.ExpiresAt, 0).UTC())
} else {
return errors.New("internal error: expected to have prepared JWT authority information")
}
if r.PreparedAuthority == nil {
return errors.New("internal error: expected to have prepared JWT authority information")
}
env.Printf(" Authority ID: %s\n", r.PreparedAuthority.AuthorityId)
env.Printf(" Expires at: %s\n", time.Unix(r.PreparedAuthority.ExpiresAt, 0).UTC())

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. I'll go ahead and merge this, and then apply the suggestion in all the places where the same pattern applies, in a single separate PR.

@amartinezfayo amartinezfayo merged commit 5c6b0f4 into spiffe:main Aug 23, 2024
34 checks passed
@amartinezfayo amartinezfayo added this to the 1.11.0 milestone Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants