Skip to content

Conversation

@elyse-mdb
Copy link
Contributor

@elyse-mdb elyse-mdb commented Feb 25, 2025

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

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation in document requirements section listed in CONTRIBUTING.md (if appropriate)
  • I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
  • I have updated test/README.md (if an e2e test has been added)
  • I have run make fmt and formatted my code

Further comments

…ks to corresponding Atlas API endpoints, and link to the User Roles page.
@elyse-mdb elyse-mdb requested review from a team as code owners February 25, 2025 20:48
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
Copy link
Contributor

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

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
Copy link
Contributor

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

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
Copy link
Contributor

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

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
Copy link
Contributor

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>
Copy link
Contributor

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

Copy link
Contributor Author

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>
Copy link
Contributor

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>
Copy link
Contributor

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>
Copy link
Contributor

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>
Copy link
Contributor

Choose a reason for hiding this comment

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

strings

Copy link
Contributor

@jwilliams-mongo jwilliams-mongo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM

@andreaangiolillo andreaangiolillo merged commit 37f565e into mongodb:master Mar 5, 2025
21 of 22 checks passed
@elyse-mdb elyse-mdb deleted the DOCSP-47322 branch March 5, 2025 22:40
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