api

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNamespace = "soid"
)

Variables

View Source
var (
	ErrNotAllowed = errors.New("operation not permitted")
)

Functions

func AssertIntegrity

func AssertIntegrity(ctx context.Context) error

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 CreateGuest

func CreateGuest(ctx context.Context, namespace string) (*domain.User, error)

func GetIdentity

func GetIdentity(ctx context.Context, identityId uint) (*domain.Identity, error)

func GetNamespace

func GetNamespace(ctx context.Context, namespace string) (*domain.Namespace, error)

Exists validates that the namespace exists

func GetRole

func GetRole(ctx context.Context, roleId uint) (*domain.Role, error)

func GetRoleByName

func GetRoleByName(ctx context.Context, namespace, name string) (*domain.Role, error)

func GetRule

func GetRule(ctx context.Context, ruleId uint) (*domain.Rule, error)

func GetSession

func GetSession(ctx context.Context, sessionID uint) (*domain.Session, error)

func GetSoidConfig

func GetSoidConfig(ctx context.Context) (*domain.SOIDConfig, error)

func GetUser

func GetUser(ctx context.Context, userId uint) (*domain.User, error)

func GetUserFromIdentity

func GetUserFromIdentity(ctx context.Context, identityId uint) (*domain.User, error)

func GetUserFromSession

func GetUserFromSession(ctx context.Context, sessionID uint) (*domain.User, error)

func InitializeSoid

func InitializeSoid(ctx context.Context, configFile string) error

func Login

func Login(ctx context.Context, namespace, username, password string) (*domain.Session, error)

func Logout

func Logout(ctx context.Context, sessionID uint) error

func NewSession

func NewSession(ctx context.Context, identityID uint, namespace string) (*domain.Session, error)

func RecreateRoot

func RecreateRoot(ctx context.Context, rootUsername, rootPassword string) error

RecreateRoot removes the old rootID and recreates it with a new username/password and makes sure there is appropriate rules/roles for the root

func RemoveIdentity

func RemoveIdentity(ctx context.Context, identityID uint) error

func RemoveSession

func RemoveSession(ctx context.Context, sessionID uint) error

Types

type ListIdentitiesResult

type ListIdentitiesResult struct {
	Identities    []*domain.Identity
	TotalSize     int64
	NextPageToken string
}

func ListIdentities

func ListIdentities(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListIdentitiesResult, error)

type ListRolesResult

type ListRolesResult struct {
	Roles         []*domain.Role
	TotalSize     int64
	NextPageToken string
}

func ListRoles

func ListRoles(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListRolesResult, error)

type ListRulesResult

type ListRulesResult struct {
	Rules         []*domain.Rule
	TotalSize     int64
	NextPageToken string
}

func ListRules

func ListRules(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListRulesResult, error)

type ListSessionsResult

type ListSessionsResult struct {
	Sessions      []*domain.Session
	TotalSize     int64
	NextPageToken string
}

func ListSessions

func ListSessions(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListSessionsResult, error)

type ListUsersResult

type ListUsersResult struct {
	Users         []*domain.User
	TotalSize     int64
	NextPageToken string
}

func ListUsers

func ListUsers(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListUsersResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL