This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
package authority
|
||||
|
||||
// Package authority contains stable boundary contract types for the authority semantic owner.
|
||||
@@ -0,0 +1,40 @@
|
||||
package authority
|
||||
|
||||
import (
|
||||
"git.cin.su/m/Assistant/contracts/identity"
|
||||
"git.cin.su/m/Assistant/platform/ids"
|
||||
)
|
||||
|
||||
type ScopeID ids.ID
|
||||
type GrantID ids.ID
|
||||
type AuthorityRevision uint64
|
||||
|
||||
type GrantClass string
|
||||
|
||||
const GrantClassCreator GrantClass = "CREATOR"
|
||||
|
||||
type Scope struct {
|
||||
ID ScopeID
|
||||
Global bool
|
||||
Label string
|
||||
}
|
||||
|
||||
// AuthorityGrant is an explicit, revisable authority record. It does not
|
||||
// derive authority from a capability, provider, or product display name.
|
||||
type AuthorityGrant struct {
|
||||
ID GrantID
|
||||
ActorID identity.ActorID
|
||||
PrincipalID identity.PrincipalID
|
||||
ScopeID ScopeID
|
||||
Class GrantClass
|
||||
Revision AuthorityRevision
|
||||
Active bool
|
||||
}
|
||||
|
||||
// AuthorizationContext is the Authority owner's serializable validation
|
||||
// input. Consumers do not depend directly on Identity's contract.
|
||||
type AuthorizationContext struct {
|
||||
Binding identity.PrincipalBinding
|
||||
Scope Scope
|
||||
Grant AuthorityGrant
|
||||
}
|
||||
Reference in New Issue
Block a user