Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update artifactory store to allow anonymous access #1011

Merged
merged 6 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/store/artifactory_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ func NewArtifactoryStore(options ArtifactoryStoreOptions) (Store, error) {
if err != nil {
return nil, err
}
rtDetails.SetAccessToken(token)

// If the token is set to "anonymous", we don't need to set the access token.
if token != "anonymous" {
rtDetails.SetAccessToken(token)
}

serviceConfig, err := config.NewConfigBuilder().
SetServiceDetails(rtDetails).
Expand Down
mcalhoun marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ stores:
The Artifactory store supports using an access token for authentication. The access token can be set directly in the
`atmos.yaml` or via the `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variables.

NOTE: It is not recommended to set the access token in plain text in `atmos.yaml` as it is not secure. Specifying the
access token via config is allowed so that you can support the use case where you have multiple Artifactory stores
in `atmos.yaml` and you need to specify different access tokens for each. In this case, you can use the `!env`
It is also possible to specify the access token as `anonymous` to use the anonymous user to access the Artifactory
repository if the repository is configured to allow anonymous access.

**NOTE:** Storing sensitive access tokens in plain text in `atmos.yaml` is not secure and should be avoided. However, it's recommended for the `anonymous` use case or when managing multiple Artifactory stores with different access tokens. In such cases, use [`!env`](/core-concepts/stacks/yaml-functions/env) function to reference tokens securely.
YAML function to set the access token from an environment variable.

### AWS SSM Parameter Store
Expand Down
Loading