-
Notifications
You must be signed in to change notification settings - Fork 88
CLOUDP-298177: Improve apiKey creation examples #3718
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
Conversation
|
APIx Bot |
| # Create an organization API key with the GROUP_SEARCH_INDEX_EDITOR and GROUP_DATABASE_ACCESS_ADMIN roles and assign it to the project with ID 5e2211c17a3e5a48f5497de3: | ||
| atlas projects apiKeys create --desc "My API key" --projectId 5e1234c17a3e5a48f5497de3 --role GROUP_SEARCH_INDEX_EDITOR,GROUP_DATABASE_ACCESS_ADMIN --output json`, | ||
| # Create an organization API key with the ORG_OWNER and GROUP_SEARCH_INDEX_EDITOR roles and assign it to the project with ID 5e2211c17a3e5a48f5497de3: | ||
| atlas projects apiKeys create --desc "My API key" --projectId 5e1234c17a3e5a48f5497de3 --role ORG_OWNER,GROUP_SEARCH_INDEX_EDITOR --output json`, |
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.
the problem with this example is this text
you must authenticate with a user account or an API key with the Project User Admin role.
to be able to add org roles the user needs to have Org user admin
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.
Ah, understood. In that case I'll revert the example to only project roles and specify this requirement in the description.
| Use: "create", | ||
| Short: "Create an organization API key and assign it to your project.", | ||
| Long: `MongoDB returns the private API key only once. After you run this command, immediately copy, save, and secure both the public and private API keys. | ||
| By default, the specified project's parent organization will be assigned as organization member. You must authenicate with a user account or API key with the Organization User Admin role to set organization roles. |
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.
I think for consistency
You must authenticate with a user account or API key with the Organization User Admin role to set organization roles
should go after the required role, (also typo in "authenicate"`)
| By default, the specified project's parent organization will be assigned as organization member. You must authenicate with a user account or API key with the Organization User Admin role to set organization roles. | ||
| ` + fmt.Sprintf(usage.RequiredRole, "Project User Admin"), |
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.
| By default, the specified project's parent organization will be assigned as organization member. You must authenicate with a user account or API key with the Organization User Admin role to set organization roles. | |
| ` + fmt.Sprintf(usage.RequiredRole, "Project User Admin"), | |
| If you don't provide an organization level role the API Key defaults to organization member of the project parent organization. | |
| To use this command, you must authenticate with a user account or an API key with the Project User Admin role or Organization User Admin to manage organization level roles.`, |
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.
maybe? this command help is hard
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.
Added with small amendment to second phrase to fit in with usage.RequiredOneOfRoles phrasing.
Is now To use this command, you must authenticate with a user account or an API key with any of the following roles: Project User Admin or Organization User Admin to manage organization level roles.
b72e77e to
8c8e074
Compare
gssbzn
left a comment
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.
LGTM thanks for iterating with me over this
Proposed changes
Adds example to
atlas projects apiKeys createoutlining how to use the command with multiple lesser privilege roles.Allowing for UI role names has not been implemented now that linked documentation explicits the mapping of role names across UI and CLI/API/etc.
Jira ticket: CLOUDP-298177
Checklist
make fmtand formatted my code