-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 ability to create tokens #498
Merged
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
ed0177f
WIP[SPIKE]: Create project token and policies
dthomson25 63fecea
Accept proj tokens based on createdAt time
dthomson25 e8c18a0
Modify CLI to have token subcommand
dthomson25 66b5beb
Add tests for create token and create token Policies
dthomson25 8de9f28
Push all create token logic server side
dthomson25 b77b745
Refactor create policy token to use update endpoint
dthomson25 1d2f846
Add Policy delete and token delete cli commands
dthomson25 c72fab0
Add policy validation
dthomson25 f5f5973
Fix broken tests
dthomson25 94eaf6f
Refactor token to use more generic role
dthomson25 ba92991
Move argocd specific enforcement to projects server
dthomson25 e307e40
Refactor cli to leverage roles instead of tokens
dthomson25 0c0b60a
Remove RoleMetadata to only use JwtToken
dthomson25 c8b9c72
Move argocd specific rbac impl to server
dthomson25 49bb3ba
Restrict tokens to applications instead of projects
dthomson25 07e94dd
Move GetRoleIndexByName to a util lib
dthomson25 369c6a1
Add create/delete role commands to project cli
dthomson25 46ee59e
Refactor project errors to send status instead of regular errors
dthomson25 4c8c3b7
Fix formating
dthomson25 ec0fee6
Add ability to stop multiple tokens
dthomson25 4a91e71
Add expiresAt field to JwtToken
dthomson25 3af90e9
Add explicit deny to project tokens
dthomson25 55a5251
Add defaultEnforcer func to e2e tests
dthomson25 879dca8
Use argoproj time lib to enter time
dthomson25 6299abc
Renew JwtToken to JWTToken to find golang standard
dthomson25 fdb6a40
Refactor create/delete token api
dthomson25 84a377e
Rename imports to not use camelCase
dthomson25 28188f5
Remove missed created_at
dthomson25 37c1036
Reorder imports to fix style convention
dthomson25 3640cd1
Refactor out GetInt64Field
dthomson25 8b866ae
Add Expires at to role list
dthomson25 72eefaf
Make error message more clear
dthomson25 e810855
Add comment to policy in types.go
dthomson25 7f1722f
Make create/delete token idempotent
dthomson25 51c3209
Refactor all role commands into single method
dthomson25 b387c23
Fix typos
dthomson25 2841b89
Refactor to make errors cleaner
dthomson25 b2218a4
Rerun dep ensure after upgrading v5
dthomson25 3d390f2
Rename cli variable for better consistency
dthomson25 b394685
Remove duplicate validation in CLI
dthomson25 b90118e
Add description to the role
dthomson25 d6d5fce
Refactor CLI to getting role cleaner
dthomson25 1a9d159
Humanize IssueAt and ExpiredAt values in CLI
dthomson25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add Expires at to role list
- Loading branch information
commit 8b866ae518c58cd313b09b0343151492914915e2
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a token does not expire, I think this is going to print epoch zero (1970). Instead we should print
<none>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I see that it will print
0
since this is '%d'. Instead can we print the issued at and expiration time in a human readable format. e.g. 2018-08-15T12:13:14?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed this issue by breaking the list role command into a list role and a get role command. The list role command would list all the roles and their descriptions. The get role command would list the name, description, policies, and JWT tokens of a role in a project. With the JWT token, the cli lists the issue-at value as a ID to used in the delete-token and two human readable tokens for issued-at and expires-at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example output: