Learn how to create, manage, and use Personal Access Tokens (PATs) to authenticate with DepAegis across npm, NuGet, Docker, and CI/CD pipelines.
Access tokens (also called Personal Access Tokens or PATs) are long-lived authentication credentials that replace passwords in automated workflows. Instead of typing your password every time you publish a package or push a container image, you create a token and use it in your tool configuration.
DepAegis tokens are prefixed with dap_ (e.g. dap_abc123def456...) and can be scoped to specific permissions and organizations.
npm-ci, docker-dev).Scopes control what a token can do. Choose the narrowest scope that satisfies your use case:
| Scope | Permissions | Typical Use |
|---|---|---|
read | Install, restore, pull packages and images | Developer workstations, production servers |
write | All read permissions + publish, push | CI/CD publish pipelines |
admin | All write permissions + delete, manage org settings | Organization administrators |
org:manage | Manage organization members, billing, and policies | Organization owners |
read-scoped token for production servers, a write-scoped token for CI/CD, and an admin token stored in a secrets manager for administrative operations.Every token has an expiration date. DepAegis supports the following expiration options:
Configure your .npmrc file to use a DepAegis token for authentication. The token goes in the _authToken field:
//app.depaegis.com/:_authToken=${DEPAEGIS_TOKEN}Set the DEPAEGIS_TOKEN environment variable in your shell or CI configuration. This keeps the token out of your source tree entirely.
//app.depaegis.com/:_authToken=dap_abc123def456....npmrc, always reference an environment variable. Add any .npmrc containing real tokens to your .gitignore.For full npm setup instructions, see the Configuring npm guide.
Pass the token as the --api-key when pushing packages:
dotnet nuget push MyPackage.1.0.0.nupkg \
--source "https://app.depaegis.com/api/v1/nuget/v3/index.json" \
--api-key "dap_abc123def456..."To avoid passing the key on the command line, store it with dotnet nuget setapikey:
dotnet nuget setapikey "dap_abc123def456..." \
--source "DepAegis"Or configure it in nuget.config using environment variable substitution:
<packageSourceCredentials>
<DepAegis>
<add key="Username" value="token" />
<add key="ClearTextPassword" value="%DEPAEGIS_TOKEN%" />
</DepAegis>
</packageSourceCredentials>For full NuGet setup instructions, see the Configuring NuGet guide.
Authenticate Docker against the DepAegis container registry using a token as the password:
echo "dap_abc123def456..." | \
docker login app.depaegis.com -u your-username --password-stdinYou can also use the token directly (less secure — visible in shell history):
docker login app.depaegis.com -u your-username -p "dap_abc123def456..."--password-stdin and read the token from a secrets variable. This prevents the token from appearing in build logs.For full Docker setup instructions, see the Configuring Docker guide.
In automated pipelines, store the token as a secret environment variable and reference it in your tool configuration. Here are patterns for common CI/CD platforms:
# Store DEPAEGIS_TOKEN as a repository secret
# Settings → Secrets and variables → Actions → New repository secret
- name: Publish npm package
run: npm publish
env:
DEPAEGIS_TOKEN: ${{ secrets.DEPAEGIS_TOKEN }}
- name: Push Docker image
run: |
echo "${{ secrets.DEPAEGIS_TOKEN }}" | \
docker login app.depaegis.com -u "${{ secrets.DEPAEGIS_USERNAME }}" --password-stdin
docker push app.depaegis.com/my-org/my-app:${{ github.sha }}# Store DEPAEGIS_TOKEN as a CI/CD variable
# Settings → CI/CD → Variables
publish:
stage: deploy
script:
- npm publish
variables:
DEPAEGIS_TOKEN: $DEPAEGIS_TOKEN# Store DEPAEGIS_TOKEN as a pipeline variable (secret)
# Pipelines → Library → Variable groups
- task: NuGetCommand@2
inputs:
command: push
publishFeedCredentials: DepAegis
env:
DEPAEGIS_TOKEN: $(DEPAEGIS_TOKEN)Regularly rotating tokens limits the damage window if a token is leaked. Follow these guidelines:
If a token is compromised, revoke it immediately:
Revocation is instant — all API calls using the revoked token will return 401 Unauthorized within seconds.
curl -X DELETE \
-H "Authorization: Bearer $DEPAEGIS_ADMIN_TOKEN" \
"https://app.depaegis.com/api/v1/tokens/dap_abc123def456...".npmrc, nuget.config, and config.json with real tokens to .gitignore.read-only token is sufficient for restoring packages in production. Reserve write and admin tokens for publishing and administration.github-actions-publish or dev-laptop-jane so you can quickly identify which token to revoke if needed.