Skip to content

Many-to-one account map #211

Description

@cmelone

Problem/Opportunity Statement

Hubcast users/admins may want the capability to perform actions as a bot user on behalf of contributors. For example, a spackbot user on the destination forge would be responsible for pushing new changes, managing webhooks, etc. For large projects and infrastructure that do not require strict checks to execute new code (ie the Spack CI farm), this is an alternative to using an account map.

There are a couple ways to go about this:

  1. a bot user is designated for the entire Hubcast instance; all repository actions on the destination forge are performed by the bot. account map functionality would be effectively disabled.
  2. individual projects get to choose the scheme. ex: project A wants to use an OAuth account map between Github and Gitlab, but project B is fine using a bot user. This would be a bit more difficult to implement, and I don't know if this feature would be useful. The bot user in option (1) is intended as a safe keeper of the infrastructure available on the source forge, and that dynamic doesn't change on a per-project basis.

Implementation nuances for option (1):

  • the bot user would need to be granted "maintainer" access to each repository; otherwise, the initial webhook setup for a repo won't work. this can be done on an Gitlab instance basis, but just needs to be documented.
  • admins of the Hubcast instance should create a PAT for the bot user with r/w access to all repos. this will be stored as an env variable HC_GL_TOKEN, with the admin being responsible for rotating.
  • downscoping/impersonation tokens should not be used in combination with this feature (there is only one user to impersonate, and better to have one token defined than one being created for every use).

something else I want to do:

  • rename the single token type to service_account

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions