-
Notifications
You must be signed in to change notification settings - Fork 88
(DOCSP-47322) [CLI] Update --role flag description to link to API docs and User Roles page #3689
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
…ks to corresponding Atlas API endpoints, and link to the User Roles page.
internal/usage/usage.go
Outdated
| CreateProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/createProjectApiKey>`. To learn more about project level user roles, see :atlas:`/reference/user-roles/#project-roles`." //nolint:gosec // This is just a message not a credential | ||
| AddProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/addProjectApiKey>`. To learn more about project level user roles, see :atlas:`/reference/user-roles/#project-roles`." //nolint:gosec // This is just a message not a credential | ||
| CreateAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/createApiKey>`. To learn more about organization level user roles, see :atlas:`/reference/user-roles/#organization-roles`." //nolint:gosec // This is just a message not a credential | ||
| UpdateAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/updateApiKey>`. To learn more about organization level user roles, see :atlas:`/reference/user-roles/#organization-roles`." //nolint:gosec // This is just a message not a credential |
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 believe we should hard-code this link as this message appears in the CLI help text
internal/usage/usage.go
Outdated
| AtlasAPIKeyDescription = APIKeyDescription + " " + requiredForAtlas | ||
| CreateProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/createProjectApiKey>`. To learn more about project level user roles, see :atlas:`/reference/user-roles/#project-roles`." //nolint:gosec // This is just a message not a credential | ||
| AddProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/addProjectApiKey>`. To learn more about project level user roles, see :atlas:`/reference/user-roles/#project-roles`." //nolint:gosec // This is just a message not a credential | ||
| CreateAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/createApiKey>`. To learn more about organization level user roles, see :atlas:`/reference/user-roles/#organization-roles`." //nolint:gosec // This is just a message not a credential |
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 believe we should hard-code this link as this message appears in the CLI help text
internal/usage/usage.go
Outdated
| AtlasAPIKeyRoles = APIKeyRoles + requiredForAtlas | ||
| AtlasAPIKeyDescription = APIKeyDescription + " " + requiredForAtlas | ||
| CreateProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/createProjectApiKey>`. To learn more about project level user roles, see :atlas:`/reference/user-roles/#project-roles`." //nolint:gosec // This is just a message not a credential | ||
| AddProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/addProjectApiKey>`. To learn more about project level user roles, see :atlas:`/reference/user-roles/#project-roles`." //nolint:gosec // This is just a message not a credential |
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 believe we should hard-code this link as this message appears in the CLI help text
internal/usage/usage.go
Outdated
| ProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. To learn which values the CLI accepts, see the Items Enum for roles in the Atlas API spec: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createProjectApiKey." //nolint:gosec // This is just a message not a credential | ||
| AtlasAPIKeyRoles = APIKeyRoles + requiredForAtlas | ||
| AtlasAPIKeyDescription = APIKeyDescription + " " + requiredForAtlas | ||
| CreateProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding :oas-atlas-tag:`Atlas API endpoint </Programmatic-API-Keys/operation/createProjectApiKey>`. To learn more about project level user roles, see :atlas:`/reference/user-roles/#project-roles`." //nolint:gosec // This is just a message not a credential |
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 believe we should hard-code this link as this message appears in the CLI help text
| - Output format. Valid values are json, json-path, go-template, or go-template-file. To see the full output, use the -o json option. | ||
| * - --role | ||
| - strings | ||
| - Atlas API endpoint </Programmatic-API-Keys/operation/updateApiKey> |
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 this should still be strings
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 all of the "string" rows were replaced when the autogenerated files glitched over my role directives, so they're fixed now that I fixed up the links!
| - Output format. Valid values are json, json-path, go-template, or go-template-file. To see the full output, use the -o json option. | ||
| * - --role | ||
| - strings | ||
| - Atlas API endpoint </Programmatic-API-Keys/operation/createApiKey> |
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 this should still be strings
| - Description of the API key. Required when creating organizations authenticated with API Keys. | ||
| * - --apiKeyRole | ||
| - strings | ||
| - Atlas API endpoint </Programmatic-API-Keys/operation/createApiKey> |
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.
strings
| - Hexadecimal string that identifies the project to use. This option overrides the settings in the configuration file or environment variable. | ||
| * - --role | ||
| - strings | ||
| - Atlas API endpoint </Programmatic-API-Keys/operation/addProjectApiKey> |
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.
strings
| - Hexadecimal string that identifies the project to use. This option overrides the settings in the configuration file or environment variable. | ||
| * - --role | ||
| - strings | ||
| - Atlas API endpoint </Programmatic-API-Keys/operation/createProjectApiKey> |
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.
strings
jwilliams-mongo
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
andreaangiolillo
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
DESCRIPTION
Help clarify which roles a user can use for the --role option by linking users to the Atlas User Roles page and the correct corresponding Atlas Admin API endpoint for each corresponding CLI command on the atlas-projects-apiKeys-create, atlas projects apiKeys assign, atlas organizations apiKeys assign, and atlas organizations apiKeys create pages.
Thanks for contributing to MongoDB Atlas CLI!
Before you submit your pull request, please review our contribution guidelines:
https://github.com/mongodb/mongodb-atlas-cli/blob/master/CONTRIBUTING.md
Please fill out the information below to help speed up the review process
and getting you pull request merged!
-->
Proposed changes
Jira ticket: DOCSP-47322
Closes #[issue number]
Checklist
make fmtand formatted my codeFurther comments