Documentation
¶
Index ¶
- func InitDb(datasourcename string, idleConns string, maxOpenConns string, connTTL string) (*gorm.DB, error)
- type Group
- type GroupPolicyRelation
- type GroupUser
- type GroupUserRelation
- type OidcClient
- type OidcProvider
- type Policy
- type PolicyGroup
- type PostgresRepo
- func (pr PostgresRepo) AddGroup(group api.Group) (*api.Group, error)
- func (pr PostgresRepo) AddMember(userID string, groupID string) error
- func (pr PostgresRepo) AddOidcProvider(oidcProvider api.OidcProvider) (*api.OidcProvider, error)
- func (pr PostgresRepo) AddPolicy(policy api.Policy) (*api.Policy, error)
- func (pr PostgresRepo) AddProxyResource(proxyResource api.ProxyResource) (*api.ProxyResource, error)
- func (pr PostgresRepo) AddUser(user api.User) (*api.User, error)
- func (pr PostgresRepo) AttachPolicy(groupID string, policyID string) error
- func (pr PostgresRepo) DetachPolicy(groupID string, policyID string) error
- func (pr PostgresRepo) GetAttachedGroups(policyID string, filter *api.Filter) ([]api.PolicyGroupRelation, int, error)
- func (pr PostgresRepo) GetAttachedPolicies(groupID string, filter *api.Filter) ([]api.PolicyGroupRelation, int, error)
- func (pr PostgresRepo) GetGroupById(id string) (*api.Group, error)
- func (pr PostgresRepo) GetGroupByName(org string, name string) (*api.Group, error)
- func (pr PostgresRepo) GetGroupMembers(groupID string, filter *api.Filter) ([]api.UserGroupRelation, int, error)
- func (pr PostgresRepo) GetGroupsByUserID(id string, filter *api.Filter) ([]api.UserGroupRelation, int, error)
- func (pr PostgresRepo) GetGroupsFiltered(filter *api.Filter) ([]api.Group, int, error)
- func (pr PostgresRepo) GetOidcProviderByName(name string) (*api.OidcProvider, error)
- func (pr PostgresRepo) GetOidcProvidersFiltered(filter *api.Filter) ([]api.OidcProvider, int, error)
- func (pr PostgresRepo) GetPoliciesFiltered(filter *api.Filter) ([]api.Policy, int, error)
- func (pr PostgresRepo) GetPolicyById(id string) (*api.Policy, error)
- func (pr PostgresRepo) GetPolicyByName(org string, name string) (*api.Policy, error)
- func (pr PostgresRepo) GetProxyResourceByName(org string, name string) (*api.ProxyResource, error)
- func (pr PostgresRepo) GetProxyResources(filter *api.Filter) ([]api.ProxyResource, int, error)
- func (pr PostgresRepo) GetUserByExternalID(id string) (*api.User, error)
- func (pr PostgresRepo) GetUserByID(id string) (*api.User, error)
- func (pr PostgresRepo) GetUsersFiltered(filter *api.Filter) ([]api.User, int, error)
- func (pr PostgresRepo) IsAttachedToGroup(groupID string, policyID string) (bool, error)
- func (pr PostgresRepo) IsMemberOfGroup(userID string, groupID string) (bool, error)
- func (pr PostgresRepo) OrderByValidColumns(action string) []string
- func (pr PostgresRepo) RemoveGroup(id string) error
- func (pr PostgresRepo) RemoveMember(userID string, groupID string) error
- func (pr PostgresRepo) RemoveOidcProvider(id string) error
- func (pr PostgresRepo) RemovePolicy(id string) error
- func (pr PostgresRepo) RemoveProxyResource(id string) error
- func (pr PostgresRepo) RemoveUser(id string) error
- func (pr PostgresRepo) UpdateGroup(group api.Group) (*api.Group, error)
- func (pr PostgresRepo) UpdateOidcProvider(oidcProvider api.OidcProvider) (*api.OidcProvider, error)
- func (pr PostgresRepo) UpdatePolicy(policy api.Policy) (*api.Policy, error)
- func (pr PostgresRepo) UpdateProxyResource(proxyResource api.ProxyResource) (*api.ProxyResource, error)
- func (pr PostgresRepo) UpdateUser(user api.User) (*api.User, error)
- type ProxyResource
- type Statement
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Group ¶
type Group struct {
ID string `gorm:"primary_key"`
Name string `gorm:"not null"`
Path string `gorm:"not null"`
Org string `gorm:"not null"`
CreateAt int64 `gorm:"not null"`
UpdateAt int64 `gorm:"not null"`
Urn string `gorm:"not null;unique"`
}
Group table
type GroupPolicyRelation ¶
type GroupPolicyRelation struct {
GroupID string `gorm:"primary_key"`
PolicyID string `gorm:"primary_key"`
CreateAt int64 `gorm:"not null"`
}
Group Policy table
func (GroupPolicyRelation) TableName ¶
func (GroupPolicyRelation) TableName() string
GroupPolicyRelation's table name
type GroupUser ¶ added in v0.2.0
GroupUser struct contains (Group-User) relationship
type GroupUserRelation ¶
type GroupUserRelation struct {
UserID string `gorm:"primary_key"`
GroupID string `gorm:"primary_key"`
CreateAt int64 `gorm:"not null"`
}
Group-Users Relationship
func (GroupUserRelation) TableName ¶
func (GroupUserRelation) TableName() string
GroupUserRelation's table name
type OidcClient ¶ added in v0.4.0
type OidcClient struct {
ID string `gorm:"primary_key"`
OidcProviderID string `gorm:"not null;unique_index:idx_oidc_client"`
Name string `gorm:"not null;unique_index:idx_oidc_client"`
}
Auth OIDC Client table
func (OidcClient) TableName ¶ added in v0.4.0
func (OidcClient) TableName() string
OidcClient's table name
type OidcProvider ¶ added in v0.4.0
type OidcProvider struct {
ID string `gorm:"primary_key"`
Name string `gorm:"not null"`
Path string `gorm:"not null"`
Urn string `gorm:"not null;unique"`
CreateAt int64 `gorm:"not null"`
UpdateAt int64 `gorm:"not null"`
IssuerURL string `gorm:"not null"`
}
Auth OIDC Provider table
func (OidcProvider) TableName ¶ added in v0.4.0
func (OidcProvider) TableName() string
OidcProvider's table name
type Policy ¶
type Policy struct {
ID string `gorm:"primary_key"`
Name string `gorm:"not null"`
Path string `gorm:"not null"`
Org string `gorm:"not null"`
CreateAt int64 `gorm:"not null"`
UpdateAt int64 `gorm:"not null"`
Urn string `gorm:"not null;unique"`
}
Policy table
type PolicyGroup ¶ added in v0.2.0
PolicyGroup struct contains (Policy-Group) relationship
func (*PolicyGroup) GetDate ¶ added in v0.2.0
func (pg *PolicyGroup) GetDate() time.Time
GetDate returns the date when the relation was created
func (*PolicyGroup) GetGroup ¶ added in v0.2.0
func (pg *PolicyGroup) GetGroup() *api.Group
GetGroup returns a Group of a PolicyGroup relation
func (*PolicyGroup) GetPolicy ¶ added in v0.2.0
func (pg *PolicyGroup) GetPolicy() *api.Policy
GetPolicy returns a Policy of a PolicyGroup relation
type PostgresRepo ¶
func (PostgresRepo) AddMember ¶
func (pr PostgresRepo) AddMember(userID string, groupID string) error
func (PostgresRepo) AddOidcProvider ¶ added in v0.4.0
func (pr PostgresRepo) AddOidcProvider(oidcProvider api.OidcProvider) (*api.OidcProvider, error)
func (PostgresRepo) AddProxyResource ¶ added in v0.3.0
func (pr PostgresRepo) AddProxyResource(proxyResource api.ProxyResource) (*api.ProxyResource, error)
func (PostgresRepo) AttachPolicy ¶
func (pr PostgresRepo) AttachPolicy(groupID string, policyID string) error
func (PostgresRepo) DetachPolicy ¶
func (pr PostgresRepo) DetachPolicy(groupID string, policyID string) error
func (PostgresRepo) GetAttachedGroups ¶
func (pr PostgresRepo) GetAttachedGroups(policyID string, filter *api.Filter) ([]api.PolicyGroupRelation, int, error)
func (PostgresRepo) GetAttachedPolicies ¶
func (pr PostgresRepo) GetAttachedPolicies(groupID string, filter *api.Filter) ([]api.PolicyGroupRelation, int, error)
func (PostgresRepo) GetGroupById ¶
func (pr PostgresRepo) GetGroupById(id string) (*api.Group, error)
func (PostgresRepo) GetGroupByName ¶
func (PostgresRepo) GetGroupMembers ¶
func (pr PostgresRepo) GetGroupMembers(groupID string, filter *api.Filter) ([]api.UserGroupRelation, int, error)
func (PostgresRepo) GetGroupsByUserID ¶
func (pr PostgresRepo) GetGroupsByUserID(id string, filter *api.Filter) ([]api.UserGroupRelation, int, error)
func (PostgresRepo) GetGroupsFiltered ¶
func (PostgresRepo) GetOidcProviderByName ¶ added in v0.4.0
func (pr PostgresRepo) GetOidcProviderByName(name string) (*api.OidcProvider, error)
func (PostgresRepo) GetOidcProvidersFiltered ¶ added in v0.4.0
func (pr PostgresRepo) GetOidcProvidersFiltered(filter *api.Filter) ([]api.OidcProvider, int, error)
func (PostgresRepo) GetPoliciesFiltered ¶
func (PostgresRepo) GetPolicyById ¶
func (pr PostgresRepo) GetPolicyById(id string) (*api.Policy, error)
func (PostgresRepo) GetPolicyByName ¶
func (PostgresRepo) GetProxyResourceByName ¶ added in v0.3.0
func (pr PostgresRepo) GetProxyResourceByName(org string, name string) (*api.ProxyResource, error)
func (PostgresRepo) GetProxyResources ¶ added in v0.3.0
func (pr PostgresRepo) GetProxyResources(filter *api.Filter) ([]api.ProxyResource, int, error)
func (PostgresRepo) GetUserByExternalID ¶
func (pr PostgresRepo) GetUserByExternalID(id string) (*api.User, error)
func (PostgresRepo) GetUserByID ¶
func (pr PostgresRepo) GetUserByID(id string) (*api.User, error)
func (PostgresRepo) GetUsersFiltered ¶
func (PostgresRepo) IsAttachedToGroup ¶
func (pr PostgresRepo) IsAttachedToGroup(groupID string, policyID string) (bool, error)
func (PostgresRepo) IsMemberOfGroup ¶
func (pr PostgresRepo) IsMemberOfGroup(userID string, groupID string) (bool, error)
func (PostgresRepo) OrderByValidColumns ¶ added in v0.3.0
func (pr PostgresRepo) OrderByValidColumns(action string) []string
func (PostgresRepo) RemoveGroup ¶
func (pr PostgresRepo) RemoveGroup(id string) error
func (PostgresRepo) RemoveMember ¶
func (pr PostgresRepo) RemoveMember(userID string, groupID string) error
func (PostgresRepo) RemoveOidcProvider ¶ added in v0.4.0
func (pr PostgresRepo) RemoveOidcProvider(id string) error
func (PostgresRepo) RemovePolicy ¶
func (pr PostgresRepo) RemovePolicy(id string) error
func (PostgresRepo) RemoveProxyResource ¶ added in v0.3.0
func (pr PostgresRepo) RemoveProxyResource(id string) error
func (PostgresRepo) RemoveUser ¶
func (pr PostgresRepo) RemoveUser(id string) error
func (PostgresRepo) UpdateGroup ¶
func (PostgresRepo) UpdateOidcProvider ¶ added in v0.4.0
func (pr PostgresRepo) UpdateOidcProvider(oidcProvider api.OidcProvider) (*api.OidcProvider, error)
func (PostgresRepo) UpdatePolicy ¶
func (PostgresRepo) UpdateProxyResource ¶ added in v0.3.0
func (pr PostgresRepo) UpdateProxyResource(proxyResource api.ProxyResource) (*api.ProxyResource, error)
func (PostgresRepo) UpdateUser ¶
type ProxyResource ¶ added in v0.3.0
type ProxyResource struct {
ID string `gorm:"primary_key"`
Name string `gorm:"not null"`
Org string `gorm:"not null"`
Path string `gorm:"not null"`
Host string `gorm:"not null;unique_index:idx_resource"`
PathResource string `gorm:"not null;unique_index:idx_resource"`
Method string `gorm:"not null;unique_index:idx_resource"`
UrnResource string `gorm:"not null;unique_index:idx_resource"`
Urn string `gorm:"not null"`
Action string `gorm:"not null;unique_index:idx_resource"`
CreateAt int64 `gorm:"not null"`
UpdateAt int64 `gorm:"not null"`
}
ProxyResource table
func (ProxyResource) TableName ¶ added in v0.3.0
func (ProxyResource) TableName() string
ProxyResource's table name
type Statement ¶
type Statement struct {
ID string `gorm:"primary_key"`
PolicyID string `gorm:"not null"`
Effect string `gorm:"not null"`
Actions string `gorm:"not null"`
Resources string `gorm:"not null"`
}
Statement table
Click to show internal directories.
Click to hide internal directories.