Skip to main content

Share Bundles with Projects

A repo grant gives projects repo:pull on a repository, which lets them add components from its bundles. Without a grant, a project cannot add a component from the bundle, even if its members can see the bundle in the catalog.

Grants match recipient projects by attribute. Every current and future project with matching attributes receives the grant.

Default access for new repositories​

New repositories are restricted until a grant exists. To give every new repository an organization-wide repo:pull grant, turn on Grant new bundle repositories to all projects under Organization settings → General. In the API, this is defaultBundleAccess: ALL_PROJECTS on updateOrganizationSettings. The grant can be revoked like any other. Existing repositories are not affected.

To share one repository, or to share with some projects, follow the steps below.

Prerequisites​

  • repo:grant on the repository. Organization admins have it. Otherwise, add it to a group policy.
  • To match projects by a tag such as team, a custom attribute that applies to projects. Not needed to share by project id or with the whole organization.

1. Tag the recipient projects​

On each project that should receive the bundle, open the Settings tab and set the attribute, for example team = payments.

Prefer the CLI?
shell
mass project update ecomm -a team=payments

-a replaces all of the project's custom attributes. Include the ones you want to keep.

2. Create the grant​

Open the repository under Repositories, open the Permissions tab, and click Add permission. Set the recipient conditions.

Prefer the CLI?
shell
mass repository grant create aws-aurora-postgres --condition team=payments
mass repository grant create aws-aurora-postgres --all-projects
mass repository grant list aws-aurora-postgres

Repeat --condition with the same key to accept several values, or pass key=* to accept any value.

Recipient conditions​

Each condition is a key and one or more values. A project matches when it has every key with one of the listed values. More conditions narrow the match; more values widen it. * as the value matches any project that has the key.

Share withKeyValues
Projects with the custom attribute team equal to paymentsteampayments
Projects with the custom attribute team equal to payments or checkoutteampayments checkout
Only the project with the id ecommmd-projectecomm
Any project that has the custom team attribute setteam*
Every project in the org**

Grants can also be managed with the createRepoGrant mutation and the Terraform provider's massdriver_oci_repository_grant resource. Matching rules are in Access Control.

3. Verify​

In a recipient project, open the Bundles drawer on the canvas and add a component from the shared bundle. If the bundle is missing or the add fails, check that:

  • The project's attributes match the grant's conditions.
  • Your group has repo:view on the repository. Grants control use; group policies control who can see the repository.

Revoke​

Grants are immutable. To change one, delete it from the repository's Permissions tab, or with mass repository grant delete <grant-id>, and create a new one.