Documentation
¶
Index ¶
- Variables
- func AddRole(ctx context.Context, namespace, name string, rules []domain.Rule) (*domain.Role, error)
- func AddUser(ctx context.Context, namespace, name, password string, ...) (*domain.User, error)
- func AssertSoidNamespace(ctx context.Context) error
- func AssertSystemNamespace(ctx context.Context) error
- func Check(ctx context.Context, identityId int32, ...) (int, error)
- func CheckAccess(ctx context.Context, identityID uint, ...) error
- func CreateAdminUser(ctx context.Context, namespace, username, password string) (*domain.User, error)
- func CreateDefaultSoidRoles(ctx context.Context, namespace string) error
- func CreateGuestUser(ctx context.Context, namespace string) (*domain.User, error)
- func CreateIdentity(ctx context.Context, namespace string, ...) (*domain.Identity, error)
- func CreateRole(ctx context.Context, namespace string, ...) (*domain.Role, error)
- func CreateRule(ctx context.Context, namespace string, ...) (*domain.Rule, error)
- func CreateRuleFromTemplate(ctx context.Context, namespace, name string, other *domain.Rule) (*domain.Rule, error)
- func CreateUser(ctx context.Context, namespace string, ...) (*domain.User, error)
- func DefaultSoidAdminRules(ctx context.Context, namespace string) []domain.Rule
- func DefaultSoidGuestRules(ctx context.Context, namespace string) []domain.Rule
- func GetUserFromSession(ctx context.Context, sessionID uint) (*domain.User, error)
- func IdentifyByPassword(ctx context.Context, namespace, username, password string) (*domain.Identity, error)
- func InitializeNamespace(ctx context.Context, namespace, adminuser, adminpass string) error
- func Login(ctx context.Context, namespace, username, password string) (*domain.Session, error)
- func Logout(ctx context.Context, sessionID uint) error
- func RecreateRoot(ctx context.Context, rootUsername, rootPassword string) error
- func RegisterAccess(ctx context.Context, sessionID uint, ipAddress string) error
- func Validate(ctx context.Context, sessionID uint) error
- func ValidateRole(ctx context.Context, namespace, name string, hasRules []domain.Rule) (*domain.Role, error)
- func ValidateRule(ctx context.Context, ruleNamespace, ruleName string, other *domain.Rule) (*domain.Rule, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddRole ¶
func AddRole(ctx context.Context, namespace, name string, rules []domain.Rule) (*domain.Role, error)
Add a Role to the namespace with a name. Attach the rules provided
func AddUser ¶
func AddUser(ctx context.Context, namespace, name, password string, certificates []domain.Certificate, roles []domain.Role) (*domain.User, error)
AddGuest adds a user and identity that has namespace:name and attaches the provided set of roles to the identity Username will be set to same as name Password can be empty, in which case no password is needed to log in Any certificates provided are added to the identity A name can be generated using factory.NewUsername
func AssertSoidNamespace ¶
AssertSoidNamespace is called when we need to assert that the basic data in the SOID namespace are there for SOID to work properly. It is typically called upon startup of the application
func AssertSystemNamespace ¶
AssertSystemNamespace is called when we need to assert that the basic data in the system namespace are there for SOID to work properly. It is typically called upon startup of the application
func Check ¶
func Check(ctx context.Context, identityId int32, objectType, namespace, operation, entityId string) (int, error)
Check the permissions for a certain combination of namespace/entity and identity
func CheckAccess ¶
func CheckAccess(ctx context.Context, identityID uint, namespace, name, operation, objectType string, instances []domain.Metadata) error
CheckAccess returns nil if the operation is allowed, otherwis an error is returned
func CreateAdminUser ¶
func CreateDefaultSoidRoles ¶
func CreateGuestUser ¶
func CreateIdentity ¶
func CreateRole ¶
func CreateRule ¶
func CreateRuleFromTemplate ¶
func CreateUser ¶
func DefaultSoidAdminRules ¶
func DefaultSoidGuestRules ¶
func GetUserFromSession ¶
func IdentifyByPassword ¶
func InitializeNamespace ¶
func RecreateRoot ¶
RecreateRoot removes the old rootID and recreates it with a new username/password and at the same time ensures the AllowAll rule and the Root Role exists
func RegisterAccess ¶
func ValidateRole ¶
func ValidateRole(ctx context.Context, namespace, name string, hasRules []domain.Rule) (*domain.Role, error)
Validate that a role with the namespace/name has roles that are attached to the rules that are as permissive as the provided rules. The role/rules will be recreated if they don't apply
Types ¶
This section is empty.