Skip to content

Commit 3bd9acc

Browse files
committed
feat: establish secret realms
Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
1 parent 206b13f commit 3bd9acc

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

x/realms/docker.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package realms
2+
3+
import "github.com/docker/secrets-engine/x/secrets"
4+
5+
// Docker realms all start with `docker/` as the prefix.
6+
//
7+
// Authentication flows done by the Docker CLI, Docker Desktop and Docker related
8+
// products must go through `docker/auth`.
9+
//
10+
// Docker Hub authentication (browser based OAuth login) will be prefixed
11+
// with `docker/auth/hub/<username>`.
12+
//
13+
// Docker Registry authentication will be prefixed with
14+
// `docker/auth/registry/docker/<username>`.
15+
var (
16+
DockerHubAuthentication = secrets.MustParsePattern("docker/auth/hub/**")
17+
DockerHubStagingAuthentication = secrets.MustParsePattern("docker/auth/hub-staging/**")
18+
DockerRegistryAuthentication = secrets.MustParsePattern("docker/auth/registry/docker/**")
19+
DockerRegistryStagingAuthentication = secrets.MustParsePattern("docker/auth/registry/docker-staging/**")
20+
)

x/realms/realm.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Package realms keeps track of known Docker realms
2+
//
3+
// Realms do not define a permission model and should not be used as such!
4+
// Realms are simply contracts that clients may use to query a set of secrets.
5+
// Once a realm has been established it MUST not change as clients would treat
6+
// the realm as a contract.
7+
// Clients may pin themselves to a specific realm or a group of realms.
8+
//
9+
// Examples:
10+
//
11+
// `docker/` is a realm for all known Docker secrets.
12+
// `docker/auth` is a realm for all known Docker Auth secrets.
13+
package realms

0 commit comments

Comments
 (0)