Skip to content

fix(platform_global_role): remove hardcoded actions validation - #338

Open
kingcrunch wants to merge 2 commits into
jfrog:mainfrom
kingcrunch:bugfix/332-global-role-actions
Open

fix(platform_global_role): remove hardcoded actions validation#338
kingcrunch wants to merge 2 commits into
jfrog:mainfrom
kingcrunch:bugfix/332-global-role-actions

Conversation

@kingcrunch

Copy link
Copy Markdown

Closes #332

Problem

platform_global_role.actions used a hard-coded allow-list of action values. That list did not include all values returned by the JFrog platform for predefined global roles (e.g. READ_APPLICATION, READ_APPLICATION_VERSION, READ_APPTRUST_POLICY). As a result, importing an existing role with its full action list failed with:

Error: Invalid Attribute Value Match
... value must be one of: [...], got: "READ_APPLICATION"

Change

This PR removes the OneOf validator for the actions attribute. The API itself remains the authoritative source for valid action values. The set still requires at least one element.

Note on the action list

The previous list was based on the values that the provider initially supported, but the official JFrog Access/Platform API documentation does not specify an exhaustive enum for the actions parameter. For anyone outside of JFrog's internal engineering, the complete set of allowed values can therefore only be inferred from platform behavior and responses. Maintaining a hard-coded list in the provider is not sustainable and inevitably breaks whenever the platform adds new actions.

Checklist

  • Root cause identified
  • Hard-coded validator removed
  • Documentation updated
  • go vet and go build pass
  • Existing unit tests pass

Disclaimer: This PR was created with AI assistance (opencode:kimi-k2.7-code). The human author has read, understood, and takes responsibility for the entire Pull Request.

The hardcoded list of allowed action values did not include all values
returned by the JFrog platform for predefined global roles (e.g.
READ_APPLICATION, READ_APPLICATION_VERSION, READ_APPTRUST_POLICY).
Removing the OneOf validator lets the platform API be the source of truth
for valid action values and allows importing existing roles with their
complete action list.

Closes jfrog#332

Assisted-by: opencode:kimi-k2.7-code
@soumyas-dev

Copy link
Copy Markdown
Collaborator

Hi @kingcrunch ,

Thank you for your contribution.

Our CI pipeline issues have been resolved, and we are now accepting contributions again. If you are still interested in submitting this change, please rebase your branch on master and update the CHANGELOG. We look forward to reviewing your pull request.

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.

platform_global_role.actions seemingly does not support all allowed valuwes

2 participants