Documentation ¶
Index ¶
- Variables
- type Action
- type ActionRoleMapping
- type Credential
- type CredentialRoleMapping
- type Domain
- type Entity
- type EntityDomainMapping
- type EntityRoleMapping
- type Group
- type GroupRoleMapping
- type ObjectGroupMapping
- type Role
- type Storage
- type StorageImpl
- func (self *StorageImpl) AddActionToRole(role_id, action_id string) error
- func (self *StorageImpl) AddEntityToDomain(domain_id, entity_id string) error
- func (self *StorageImpl) AddObjectToGroup(group_id, object_id string) error
- func (self *StorageImpl) AddRoleToEntity(entity_id, role_id string) error
- func (self *StorageImpl) AddRoleToGroup(group_id, role_id string) error
- func (self *StorageImpl) AddSubjectToGroup(group_id, subject_id string) error
- func (self *StorageImpl) CreateAction(act *Action) (*Action, error)
- func (self *StorageImpl) CreateCredential(cred *Credential) (*Credential, error)
- func (self *StorageImpl) CreateDomain(dom *Domain) (*Domain, error)
- func (self *StorageImpl) CreateEntity(ent *Entity) (*Entity, error)
- func (self *StorageImpl) CreateGroup(grp *Group) (*Group, error)
- func (self *StorageImpl) CreateRole(role *Role) (*Role, error)
- func (self *StorageImpl) CreateToken(tkn *Token) (*Token, error)
- func (self *StorageImpl) DeleteAction(id string) error
- func (self *StorageImpl) DeleteCredential(id string) error
- func (self *StorageImpl) DeleteDomain(id string) error
- func (self *StorageImpl) DeleteEntity(id string) error
- func (self *StorageImpl) DeleteGroup(id string) error
- func (self *StorageImpl) DeleteRole(id string) error
- func (self *StorageImpl) DeleteToken(id string) error
- func (self *StorageImpl) ExistGroup(id string) (bool, error)
- func (self *StorageImpl) GetAction(id string) (*Action, error)
- func (self *StorageImpl) GetCredential(id string) (*Credential, error)
- func (self *StorageImpl) GetDomain(id string) (*Domain, error)
- func (self *StorageImpl) GetEntity(id string) (*Entity, error)
- func (self *StorageImpl) GetEntityByName(name string) (*Entity, error)
- func (self *StorageImpl) GetGroup(id string) (*Group, error)
- func (self *StorageImpl) GetRole(id string) (*Role, error)
- func (self *StorageImpl) GetRoleWithFullActions(id string) (*Role, error)
- func (self *StorageImpl) GetToken(id string) (*Token, error)
- func (self *StorageImpl) GetTokenByText(text string) (*Token, error)
- func (self *StorageImpl) Initialize() error
- func (self *StorageImpl) IsInitialized() (bool, error)
- func (self *StorageImpl) ListActions(act *Action) ([]*Action, error)
- func (self *StorageImpl) ListCredentials(cred *Credential) ([]*Credential, error)
- func (self *StorageImpl) ListDomains(dom *Domain) ([]*Domain, error)
- func (self *StorageImpl) ListEntities(ent *Entity) ([]*Entity, error)
- func (self *StorageImpl) ListEntitiesByDomainId(id string) ([]*Entity, error)
- func (self *StorageImpl) ListGroups(grp *Group) ([]*Group, error)
- func (self *StorageImpl) ListGroupsForObject(object_id string) ([]*Group, error)
- func (self *StorageImpl) ListGroupsForSubject(subject_id string) ([]*Group, error)
- func (self *StorageImpl) ListRoles(role *Role) ([]*Role, error)
- func (self *StorageImpl) ListTokens(tkn *Token) ([]*Token, error)
- func (self *StorageImpl) ObjectExistsInGroup(object_id, group_id string) (bool, error)
- func (self *StorageImpl) PatchAction(id string, action *Action) (*Action, error)
- func (self *StorageImpl) PatchCredential(id string, credential *Credential) (*Credential, error)
- func (self *StorageImpl) PatchDomain(id string, domain *Domain) (*Domain, error)
- func (self *StorageImpl) PatchEntity(id string, entity *Entity) (*Entity, error)
- func (self *StorageImpl) PatchGroup(id string, group *Group) (*Group, error)
- func (self *StorageImpl) PatchRole(id string, role *Role) (*Role, error)
- func (self *StorageImpl) RefreshToken(id string, expires_at time.Time) error
- func (self *StorageImpl) RemoveActionFromRole(role_id, action_id string) error
- func (self *StorageImpl) RemoveEntityFromDomain(domain_id, entity_id string) error
- func (self *StorageImpl) RemoveObjectFromGroup(group_id, object_id string) error
- func (self *StorageImpl) RemoveRoleFromEntity(entity_id, role_id string) error
- func (self *StorageImpl) RemoveRoleFromGroup(group_id, role_id string) error
- func (self *StorageImpl) RemoveSubjectFromGroup(group_id, subject_id string) error
- func (self *StorageImpl) SubjectExistsInGroup(subject_id, group_id string) (bool, error)
- type SubjectGroupMapping
- type SystemConfig
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInitialized = errors.New("system initialized") InvalidArgument = errors.New("invalid argument") )
View Source
var (
SYSTEM_CONFIG_INITIALIZE = "init"
)
Functions ¶
This section is empty.
Types ¶
type ActionRoleMapping ¶
type Credential ¶
type Credential struct { Id *string CreatedAt time.Time UpdatedAt time.Time DomainId *string `gorm:"column:domain_id"` EntityId *string `gorm:"column:entity_id"` Name *string `gorm:"column:name"` Alias *string `gorm:"column:alias"` Secret *string `gorm:"column:secret"` Description *string `gorm:"column:description"` ExpiresAt *time.Time `gorm:"column:expires_at"` Domain *Domain `gorm:"-"` Entity *Entity `gorm:"-"` Roles []*Role `gorm:"-"` }
type CredentialRoleMapping ¶
type Entity ¶
type Entity struct { Id *string CreatedAt time.Time UpdatedAt time.Time Name *string `gorm:"column:name"` Alias *string `gorm:"column:alias"` Password *string `gorm:"column:password"` Extra *string `gorm:"column:extra"` Domains []*Domain `gorm:"-"` Groups []*Group `gorm:"-"` Roles []*Role `gorm:"-"` }
type EntityDomainMapping ¶
type EntityRoleMapping ¶
type Group ¶
type Group struct { Id *string CreatedAt time.Time UpdatedAt time.Time DomainId *string `gorm:"column:domain_id"` Name *string `gorm:"column:name"` Alias *string `gorm:"column:alias"` Description *string `gorm:"column:description"` Extra *string `gorm:"column:extra"` Domain *Domain `gorm:"-"` Subjects []*Entity `gorm:"-"` Objects []*Entity `gorm:"-"` Roles []*Role `gorm:"-"` }
type GroupRoleMapping ¶
type ObjectGroupMapping ¶
type Storage ¶
type Storage interface { IsInitialized() (bool, error) Initialize() error CreateDomain(*Domain) (*Domain, error) DeleteDomain(id string) error PatchDomain(id string, domain *Domain) (*Domain, error) GetDomain(id string) (*Domain, error) ListDomains(*Domain) ([]*Domain, error) AddEntityToDomain(domain_id, entity_id string) error RemoveEntityFromDomain(domain_id, entity_id string) error CreateAction(*Action) (*Action, error) DeleteAction(id string) error PatchAction(id string, action *Action) (*Action, error) GetAction(id string) (*Action, error) ListActions(*Action) ([]*Action, error) CreateRole(*Role) (*Role, error) DeleteRole(id string) error PatchRole(id string, role *Role) (*Role, error) GetRole(id string) (*Role, error) GetRoleWithFullActions(id string) (*Role, error) ListRoles(*Role) ([]*Role, error) AddActionToRole(role_id, action_id string) error RemoveActionFromRole(role_id, action_id string) error CreateEntity(*Entity) (*Entity, error) DeleteEntity(id string) error PatchEntity(id string, entity *Entity) (*Entity, error) GetEntity(id string) (*Entity, error) GetEntityByName(name string) (*Entity, error) ListEntities(*Entity) ([]*Entity, error) ListEntitiesByDomainId(dom_id string) ([]*Entity, error) AddRoleToEntity(entity_id, role_id string) error RemoveRoleFromEntity(entity_id, role_id string) error CreateGroup(*Group) (*Group, error) DeleteGroup(id string) error PatchGroup(id string, group *Group) (*Group, error) GetGroup(id string) (*Group, error) ExistGroup(id string) (bool, error) ListGroups(*Group) ([]*Group, error) AddRoleToGroup(group_id, role_id string) error RemoveRoleFromGroup(group_id, role_id string) error AddSubjectToGroup(group_id, subject_id string) error RemoveSubjectFromGroup(group_id, subject_id string) error SubjectExistsInGroup(subject_id, group_id string) (bool, error) AddObjectToGroup(group_id, object_id string) error RemoveObjectFromGroup(group_id, object_id string) error ObjectExistsInGroup(object_id, group_id string) (bool, error) ListGroupsForSubject(subject_id string) ([]*Group, error) ListGroupsForObject(subject_id string) ([]*Group, error) CreateCredential(*Credential) (*Credential, error) DeleteCredential(id string) error PatchCredential(id string, credential *Credential) (*Credential, error) GetCredential(id string) (*Credential, error) ListCredentials(*Credential) ([]*Credential, error) CreateToken(*Token) (*Token, error) DeleteToken(id string) error RefreshToken(id string, expires_at time.Time) error GetTokenByText(text string) (*Token, error) GetToken(id string) (*Token, error) ListTokens(*Token) ([]*Token, error) }
func NewStorage ¶
type StorageImpl ¶
type StorageImpl struct {
// contains filtered or unexported fields
}
func NewStorageImpl ¶
func NewStorageImpl(driver, uri string, args ...interface{}) (*StorageImpl, error)
func (*StorageImpl) AddActionToRole ¶
func (self *StorageImpl) AddActionToRole(role_id, action_id string) error
func (*StorageImpl) AddEntityToDomain ¶
func (self *StorageImpl) AddEntityToDomain(domain_id, entity_id string) error
func (*StorageImpl) AddObjectToGroup ¶
func (self *StorageImpl) AddObjectToGroup(group_id, object_id string) error
func (*StorageImpl) AddRoleToEntity ¶
func (self *StorageImpl) AddRoleToEntity(entity_id, role_id string) error
func (*StorageImpl) AddRoleToGroup ¶
func (self *StorageImpl) AddRoleToGroup(group_id, role_id string) error
func (*StorageImpl) AddSubjectToGroup ¶
func (self *StorageImpl) AddSubjectToGroup(group_id, subject_id string) error
func (*StorageImpl) CreateAction ¶
func (self *StorageImpl) CreateAction(act *Action) (*Action, error)
func (*StorageImpl) CreateCredential ¶
func (self *StorageImpl) CreateCredential(cred *Credential) (*Credential, error)
func (*StorageImpl) CreateDomain ¶
func (self *StorageImpl) CreateDomain(dom *Domain) (*Domain, error)
func (*StorageImpl) CreateEntity ¶
func (self *StorageImpl) CreateEntity(ent *Entity) (*Entity, error)
func (*StorageImpl) CreateGroup ¶
func (self *StorageImpl) CreateGroup(grp *Group) (*Group, error)
func (*StorageImpl) CreateRole ¶
func (self *StorageImpl) CreateRole(role *Role) (*Role, error)
func (*StorageImpl) CreateToken ¶
func (self *StorageImpl) CreateToken(tkn *Token) (*Token, error)
func (*StorageImpl) DeleteAction ¶
func (self *StorageImpl) DeleteAction(id string) error
func (*StorageImpl) DeleteCredential ¶
func (self *StorageImpl) DeleteCredential(id string) error
func (*StorageImpl) DeleteDomain ¶
func (self *StorageImpl) DeleteDomain(id string) error
func (*StorageImpl) DeleteEntity ¶
func (self *StorageImpl) DeleteEntity(id string) error
func (*StorageImpl) DeleteGroup ¶
func (self *StorageImpl) DeleteGroup(id string) error
func (*StorageImpl) DeleteRole ¶
func (self *StorageImpl) DeleteRole(id string) error
func (*StorageImpl) DeleteToken ¶
func (self *StorageImpl) DeleteToken(id string) error
func (*StorageImpl) ExistGroup ¶
func (self *StorageImpl) ExistGroup(id string) (bool, error)
func (*StorageImpl) GetCredential ¶
func (self *StorageImpl) GetCredential(id string) (*Credential, error)
func (*StorageImpl) GetEntity ¶
func (self *StorageImpl) GetEntity(id string) (*Entity, error)
todo remove password from return. zh
func (*StorageImpl) GetEntityByName ¶
func (self *StorageImpl) GetEntityByName(name string) (*Entity, error)
func (*StorageImpl) GetRoleWithFullActions ¶
func (self *StorageImpl) GetRoleWithFullActions(id string) (*Role, error)
func (*StorageImpl) GetTokenByText ¶
func (self *StorageImpl) GetTokenByText(text string) (*Token, error)
func (*StorageImpl) Initialize ¶
func (self *StorageImpl) Initialize() error
func (*StorageImpl) IsInitialized ¶
func (self *StorageImpl) IsInitialized() (bool, error)
func (*StorageImpl) ListActions ¶
func (self *StorageImpl) ListActions(act *Action) ([]*Action, error)
func (*StorageImpl) ListCredentials ¶
func (self *StorageImpl) ListCredentials(cred *Credential) ([]*Credential, error)
func (*StorageImpl) ListDomains ¶
func (self *StorageImpl) ListDomains(dom *Domain) ([]*Domain, error)
func (*StorageImpl) ListEntities ¶
func (self *StorageImpl) ListEntities(ent *Entity) ([]*Entity, error)
func (*StorageImpl) ListEntitiesByDomainId ¶
func (self *StorageImpl) ListEntitiesByDomainId(id string) ([]*Entity, error)
func (*StorageImpl) ListGroups ¶
func (self *StorageImpl) ListGroups(grp *Group) ([]*Group, error)
func (*StorageImpl) ListGroupsForObject ¶
func (self *StorageImpl) ListGroupsForObject(object_id string) ([]*Group, error)
func (*StorageImpl) ListGroupsForSubject ¶
func (self *StorageImpl) ListGroupsForSubject(subject_id string) ([]*Group, error)
func (*StorageImpl) ListTokens ¶
func (self *StorageImpl) ListTokens(tkn *Token) ([]*Token, error)
func (*StorageImpl) ObjectExistsInGroup ¶
func (self *StorageImpl) ObjectExistsInGroup(object_id, group_id string) (bool, error)
func (*StorageImpl) PatchAction ¶
func (self *StorageImpl) PatchAction(id string, action *Action) (*Action, error)
func (*StorageImpl) PatchCredential ¶
func (self *StorageImpl) PatchCredential(id string, credential *Credential) (*Credential, error)
func (*StorageImpl) PatchDomain ¶
func (self *StorageImpl) PatchDomain(id string, domain *Domain) (*Domain, error)
func (*StorageImpl) PatchEntity ¶
func (self *StorageImpl) PatchEntity(id string, entity *Entity) (*Entity, error)
func (*StorageImpl) PatchGroup ¶
func (self *StorageImpl) PatchGroup(id string, group *Group) (*Group, error)
func (*StorageImpl) PatchRole ¶
func (self *StorageImpl) PatchRole(id string, role *Role) (*Role, error)
func (*StorageImpl) RefreshToken ¶
func (self *StorageImpl) RefreshToken(id string, expires_at time.Time) error
func (*StorageImpl) RemoveActionFromRole ¶
func (self *StorageImpl) RemoveActionFromRole(role_id, action_id string) error
func (*StorageImpl) RemoveEntityFromDomain ¶
func (self *StorageImpl) RemoveEntityFromDomain(domain_id, entity_id string) error
func (*StorageImpl) RemoveObjectFromGroup ¶
func (self *StorageImpl) RemoveObjectFromGroup(group_id, object_id string) error
func (*StorageImpl) RemoveRoleFromEntity ¶
func (self *StorageImpl) RemoveRoleFromEntity(entity_id, role_id string) error
func (*StorageImpl) RemoveRoleFromGroup ¶
func (self *StorageImpl) RemoveRoleFromGroup(group_id, role_id string) error
func (*StorageImpl) RemoveSubjectFromGroup ¶
func (self *StorageImpl) RemoveSubjectFromGroup(group_id, subject_id string) error
func (*StorageImpl) SubjectExistsInGroup ¶
func (self *StorageImpl) SubjectExistsInGroup(subject_id, group_id string) (bool, error)
type SubjectGroupMapping ¶
type SystemConfig ¶
type Token ¶
type Token struct { Id *string CreatedAt time.Time UpdatedAt time.Time DomainId *string `gorm:"column:domain_id"` EntityId *string `gorm:"column:entity_id"` CredentialId *string `gorm:"column:credential_id"` IssuedAt *time.Time `gorm:"column:issued_at"` ExpiresAt *time.Time `gorm:"column:expires_at"` Text *string `gorm:"column:text"` Domain *Domain `gorm:"-"` Entity *Entity `gorm:"-"` Credential *Credential `gorm:"-"` Roles []*Role `gorm:"-"` Groups []*Group `gorm:"-"` }
Click to show internal directories.
Click to hide internal directories.