mirror of
https://github.com/project-zot/zot.git
synced 2024-12-16 21:56:37 -05:00
c6b822f3dd
fix(authz): fix isAdmin not using groups to determine if a user is admin. fix(authz): return 401 instead of 403 403 is correct as per HTTP spec However authz is not part of dist-spec and clients know only about 401 So this is a compromise. Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package constants
|
|
|
|
import "time"
|
|
|
|
const (
|
|
ArtifactSpecRoutePrefix = "/oras/artifacts/v1"
|
|
RoutePrefix = "/v2"
|
|
Blobs = "blobs"
|
|
Uploads = "uploads"
|
|
DistAPIVersion = "Docker-Distribution-API-Version"
|
|
DistContentDigestKey = "Docker-Content-Digest"
|
|
SubjectDigestKey = "OCI-Subject"
|
|
BlobUploadUUID = "Blob-Upload-UUID"
|
|
DefaultMediaType = "application/json"
|
|
BinaryMediaType = "application/octet-stream"
|
|
DefaultMetricsExtensionRoute = "/metrics"
|
|
CallbackBasePath = "/auth/callback"
|
|
LoginPath = "/auth/login"
|
|
LogoutPath = "/auth/logout"
|
|
APIKeyPath = "/auth/apikey" //nolint: gosec
|
|
SessionClientHeaderName = "X-ZOT-API-CLIENT"
|
|
SessionClientHeaderValue = "zot-ui"
|
|
APIKeysPrefix = "zak_"
|
|
CallbackUIQueryParam = "callback_ui"
|
|
APIKeyTimeFormat = time.RFC3339
|
|
// authz permissions.
|
|
// method actions.
|
|
CreatePermission = "create"
|
|
ReadPermission = "read"
|
|
UpdatePermission = "update"
|
|
DeletePermission = "delete"
|
|
// behaviour actions.
|
|
DetectManifestCollisionPermission = "detectManifestCollision"
|
|
)
|