working commit
This commit is contained in:
+23
-4
@@ -10,12 +10,20 @@
|
||||
|
||||
package descr
|
||||
|
||||
const AnonymousID = "10000000-0000-0000-0000-000000000001"
|
||||
const (
|
||||
AnonimousUsername = "anonymous"
|
||||
AnonymousID = "10000000-0000-0000-0000-000000000001"
|
||||
ServerUsername = "server"
|
||||
ServerID = "10000000-0000-0000-0000-000000000002"
|
||||
|
||||
InitUsername = "mstore"
|
||||
InitID = "10000000-0000-0000-0000-000000000005"
|
||||
)
|
||||
|
||||
type Grant struct {
|
||||
ID string `json:"id" db:"id"`
|
||||
AccountID string `json:"accountID" db:"account_id"`
|
||||
Operation string `json:"operation" db:"operation"`
|
||||
Right string `json:"right" db:"right"`
|
||||
Pattern string `json:"pattern" db:"pattern"`
|
||||
CreatedAt string `json:"createdAt" db:"created_at"`
|
||||
UpdatedAt string `json:"updatedAt" db:"updated_at"`
|
||||
@@ -24,7 +32,7 @@ type Grant struct {
|
||||
}
|
||||
|
||||
type GrantShort struct {
|
||||
Operation string `json:"operation" db:"operation"`
|
||||
Right string `json:"right" db:"right"`
|
||||
Pattern string `json:"pattern" db:"pattern"`
|
||||
CreatedAt string `json:"createdAt" db:"created_at"`
|
||||
UpdatedAt string `json:"updatedAt" db:"updated_at"`
|
||||
@@ -33,5 +41,16 @@ type GrantShort struct {
|
||||
}
|
||||
|
||||
const (
|
||||
GrantCreateAccount = "createAccount"
|
||||
// Accounts
|
||||
RightReadAccounts = "readAccounts" // GetAccount, ListAccounts
|
||||
RightWriteAccounts = "writeAccounts" // CreateAccount, UpdateAccount, DeleteAccount
|
||||
// Frants
|
||||
RightReadGrants = "readGrants" // Like account operation
|
||||
RightWriteGrants = "writeGrants"
|
||||
// Files
|
||||
RightWriteFiles = "writeFiles" // FileInfo, GetFile, ListFiles
|
||||
RightReadFiles = "readFiles" // PutFile, DeleteFile
|
||||
// Images: manifests, layers
|
||||
RightReadImages = "readImages" // ManifestInfo, GetManifest, BlobInfo, GetBlob
|
||||
RightWriteImages = "writeImages" // other opearion
|
||||
)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
|
||||
*
|
||||
* This work is published and licensed under a Creative Commons
|
||||
* Attribution-NonCommercial-NoDerivatives 4.0 International License.
|
||||
*
|
||||
* Distribution of this work is permitted, but commercial use and
|
||||
* modifications are strictly prohibited.
|
||||
*/
|
||||
package descr
|
||||
|
||||
type Server struct {
|
||||
SchemeCreated bool `json:"SchemeCreated"`
|
||||
AnonymousCreated bool `json:"AnonymousCreated"`
|
||||
InituserCreated bool `json:"inituserCreated"`
|
||||
SchemeCreatedAt string `json:"inituserCreatedAt"`
|
||||
}
|
||||
Reference in New Issue
Block a user