Skip to content

Conversation

migmartri
Copy link
Member

@migmartri migmartri commented Jun 26, 2025

  • Support for creating project level API tokens through a new projects service
  • This service leverages new RBAC system to check that the user has permissions to that project
  • The main list of tokens for now only show system tokens
  • These tokens in practice do not differentiate at all from other types of tokens, the generation updates and RBAC check will come in another patch.

Refs #2130

Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@migmartri migmartri requested a review from javirln June 26, 2025 13:21
@migmartri migmartri changed the title 2130 add api token feat(api-tokens): project level tokens Jun 26, 2025
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Comment on lines +271 to +272
PolicyProjectAPITokenCreate,
PolicyProjectAPITokenRevoke,
Copy link
Member

Choose a reason for hiding this comment

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

Should these two be enabled for Project Viewers? They could escalate privileges, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

they are not, I think Github is messing with the visualization

Copy link
Member

Choose a reason for hiding this comment

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

right.

}

return entAPITokenToBiz(token), nil
return r.FindByID(ctx, token.ID)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this additional query needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

To make sure the resulting object contains the information about the project and org

@migmartri migmartri changed the title feat(api-tokens): project level tokens feat(api-tokens): project level tokens crud Jun 26, 2025
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@migmartri migmartri changed the title feat(api-tokens): project level tokens crud feat(api-tokens): project level tokens CRUD Jun 26, 2025
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@migmartri
Copy link
Member Author

@jiparis this is ready for review

Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Comment on lines +271 to +272
PolicyProjectAPITokenCreate,
PolicyProjectAPITokenRevoke,
Copy link
Member

Choose a reason for hiding this comment

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

right.

@migmartri migmartri merged commit b12e0cd into chainloop-dev:main Jun 26, 2025
13 checks passed
@migmartri migmartri deleted the 2130-add-api-token branch June 26, 2025 20:33
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.

2 participants