types

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Resource          *Resource `bson:"resource" json:"resource,omitempty"`
	BindingID         string    `bson:"bindingId" json:"bindingId"`
	CRUDDocumentState string    `bson:"__STATE__" json:"-"`
	Groups            []string  `bson:"groups" json:"groups,omitempty"`
	Subjects          []string  `bson:"subjects" json:"subjects,omitempty"`
	Permissions       []string  `bson:"permissions" json:"permissions,omitempty"`
	Roles             []string  `bson:"roles" json:"roles,omitempty"`
}

type BindingCreateResponse

type BindingCreateResponse struct {
	ObjectID string `json:"_id"`
}

type BindingFilter

type BindingFilter struct {
	BindingID string `bson:"bindingId" json:"bindingId"`
}

type BindingUpdate

type BindingUpdate struct {
	Groups   []string `bson:"groups" json:"groups"`
	Subjects []string `bson:"subjects" json:"subjects"`
}

type IMongoClient

type IMongoClient interface {
	Disconnect() error

	RetrieveUserBindings(ctx context.Context, user *User) ([]Binding, error)
	RetrieveRoles(ctx context.Context) ([]Role, error)
	RetrieveUserRolesByRolesID(ctx context.Context, userRolesId []string) ([]Role, error)

	FindOne(ctx context.Context, collectionName string, query map[string]interface{}) (interface{}, error)
	FindMany(ctx context.Context, collectionName string, query map[string]interface{}) ([]interface{}, error)
}

MongoClientContextKey is the context key that shall be used to save mongo Collection reference in request contexts.

type MongoClientContextKey

type MongoClientContextKey struct{}

type RequestError

type RequestError struct {
	Error      string `json:"error"`
	Message    string `json:"message"`
	StatusCode int    `json:"statusCode"`
}

type Resource

type Resource struct {
	ResourceType string `bson:"resourceType" json:"resourceType,omitempty"`
	ResourceID   string `bson:"resourceId" json:"resourceId,omitempty"`
}

type Role

type Role struct {
	RoleID            string   `bson:"roleId" json:"roleId"`
	CRUDDocumentState string   `bson:"__STATE__" json:"-"`
	Permissions       []string `bson:"permissions" json:"permissions"`
}

type User

type User struct {
	UserID       string
	UserGroups   []string
	UserRoles    []Role
	UserBindings []Binding
}

Jump to

Keyboard shortcuts

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