Download Go packages using direct repository access for the free tier

In the free tier, Assured Open Source Software packages are hosted in a Google-managed Artifact Registry repository.

This document explains how you can connect to the Artifact Registry repository for Assured OSS to directly access and download the Go packages.

This document applies to the free tier only. For the premium tier, see Download Go packages using direct repository access.

Before you begin

  1. To get the permissions that you need to get the base64-encoded string of the service account key, ask your administrator to grant you the Service Account Key Admin (roles/iam.serviceAccountKeyAdmin) IAM role on your organization. For more information about granting roles, see Manage access to projects, folders, and organizations.

    You might also be able to get the required permissions through custom roles or other predefined roles.

  2. Enable the Assured OSS free tier.
  3. Validate connectivity to Assured OSS for the requested service accounts.
  4. Enable the Artifact Registry API for the parent Google Cloud project of the service accounts used to access Assured OSS.
  5. Install the latest version of the Google Cloud CLI.
  6. If you've installed the Google Cloud CLI previously, check that you have the latest version by running this command:

    gcloud components update

Set up authentication

To set up authentication, see Set up authentication for Go.

Install Go packages

To install packages, see Use a module as a dependency.

Access packages that aren't available in Assured OSS

You can configure access to packages that aren't available in the Artifact Registry repository for Assured OSS.

To configure access, when you set up authentication, configure the GOPROXY environment variable to include https://proxy.golang.org. Add https://proxy.golang.org directly to the comma-separated list after the Artifact Registry repository URL.

For example:

export GOPROXY=https://us-go.pkg.dev/cloud-aoss/assuredoss-go-free,https://proxy.golang.org,direct

List all Go packages available in Assured OSS

To use an API to get a list of all the Go packages in the Artifact Registry repository, see List all Go packages available in Assured OSS.

What's next