Upstreams are configured in Bytesafe on the Registry page for a specific registry.
On the registry page, select the Upstreams tab.
Upstreams are registry specific, i.e. they are not shared between registries. Allowing users to configure different upstream setups for different scenarios.
On the upstreams page additional upstreams can be added to a registry, or existing deleted or edited.
|Add upstream||1. Click Add upstream on the upstream page for a registry.
2. Select upstream type in the drop-down list.
3. If required fill information as URL and auth tokens.
4. Press Add upstream to complete.
|Delete upstream||1. Select upstream on the upstream page for a registry.
2. Click the Delete button.
|Edit upstream||1. Select upstream on the upstream page for a registry.
2. Edit upstream (options depend on type of upstream)
3. Click Save changes.
Additionally the priority order of existing upstreams can be managed.
For a Bytesafe registry with more than one configured upstream, the priority of those upstreams affect how the information is fetched by Bytesafe.
When a request for available package versions is passed from a registry to an upstream, all upstreams will be searched for the requested information. But in cases where more than one registry contains the requested version the package will be pulled from the one with the highest priority.
This is beneficial if one of your upstreams always should take precedence over another.
To change the upstreams priority order, use the up and down arrows next to each upstream in the upstreams tab for a registry.
Different kinds of upstreams
Public npm registry as an upstream
Using the public npm registry (registry.npmjs.org) as an upstream is a very common use case. As such it comes pre-configured as a drop-down option when adding upstreams.
Pulling packages from the public registry does not require an authentication token and as such adding tokens for registry.npmjs.org is optional. For users that want to publish package versions from Bytesafe to the public registry, a valid authentication token is required.
To add the public registry as an upstream, select it in the drop-down list and add it to the registry (no additional fields are required).
Bytesafe registry as an upstream
Using another Bytesafe registry as an upstream is also a common use case, especially for organizations that use multiple registries for different scenarios.
When your workspace contains more than one registry, the other registries are automatically made available as possible upstreams in the drop-down list.
To add another Bytesafe registry as an upstream, simply select it in the drop-down list and add it to the registry.
URL to any npm compatible registry
Using a URL to a custom npm compatible registry is also a valid option for an upstream. This could be another Bytesafe registry outside of your workspace or any other compatible npm registry provider.
To add such an upstream, select the Custom URL option in the drop-down list in the “Other upstreams” section and add the URL to the registry and any other information required for access the registry (authentication token or similar).
Git repository as an upstream
A Git repository can also be used as an upstream for a registry. This is applicable for both public and private repositories. This enables users to pull packages dependencies that are not available in an npm registry or to access project branches directly in a Git repo.
You can add a Git repository upstream either as:
- Custom URL to the Git repo when adding a upstream. Any URL that ends in .git will be handled as a Git repo.
- Use the Github integration available in Bytesafe - this is an option for users that want to add their own GitHub repos as upstreams in Bytesafe.
For users that want to make use of Git or GitHub integrations, make sure to read the in-depth section on how to configure Git repository as upstream. This page covers common use cases and best practices when using Git with Bytesafe.