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

Gabbi/add token verify endpoint #59

Merged
merged 1 commit into from
Nov 8, 2019

Conversation

gabbifish
Copy link
Contributor

This PR adds an endpoint for verifying that an API token is active and legitimate.

PLEASE REVIEW THIS ONLY AFTER #58 HAS BEEN MERGED.

Copy link
Contributor

@ashleymichal ashleymichal left a comment

Choose a reason for hiding this comment

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

similar to the way we do other endpoints, consider a dir here for consistency (data structures in mod.rs, named files for endpoints like get_token_status.rs. there's only one endpoint though, so i won't block on this unless others also feel strongly.

permissions: Vec<String>,
roles: Vec<String>,
}

#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
pub struct UserDetails {
Copy link
Contributor

Choose a reason for hiding this comment

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

idk if a stutter is objectionable to others, but likely i would reference this module from above, so user::Details. Same w/ endpoint structs and names, so user::TokenStatus rather than user::UserTokenStatus, etc..

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree, I really like how Go encourages you to write e.g. stream.Buffered instead of stream.BufferedStream. It's nice but not essential.

Copy link
Contributor

Choose a reason for hiding this comment

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

renaming in a public api is hard, so i'd rather block today 😀

@adamchalmers
Copy link
Contributor

similar to the way we do other endpoints, consider a dir here for consistency (data structures in mod.rs, named files for endpoints like get_token_status.rs. there's only one endpoint though, so i won't block on this unless others also feel strongly.

Agree that it's nice but not necessary when you only have one file, approved.

@ashleymichal
Copy link
Contributor

added suggestions to a pr but i'm not going to block on them, this looks good.

@gabbifish gabbifish merged commit 5cc2d9f into master Nov 8, 2019
@delete-merged-branch delete-merged-branch bot deleted the gabbi/add-token-verify-endpoint branch November 8, 2019 16:24
gabbifish added a commit that referenced this pull request Nov 10, 2019
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.

3 participants