Documentation
¶
Index ¶
- Constants
- func EmbedPermissionsClientIntoRouter(client Client, router http.Handler, prefix string) http.Handler
- func GenerateGoFileWithSwaggoCommentsForEmbededPermissionsClient(packageName string, prefix string, location string) error
- func NewTestClient(ctx context.Context) (client *controller.Controller, err error)
- func NewTokenProvider(authEndpoint string, authClientId string, authClientSecret string) func() (string, error)
- func NewUserTokenProvider(authEndpoint string, authClientId string, authClientSecret string, ...) func() (string, error)
- type Client
- type ClientImpl
- func (this *ClientImpl) AdminListResourceIds(token string, topicId string, options ListOptions) (ids []string, err error, code int)
- func (this *ClientImpl) AdminLoadFromPermissionSearch(req model.AdminLoadPermSearchRequest) (updateCount int, err error, code int)
- func (this *ClientImpl) CheckMultiplePermissions(token string, topicId string, ids []string, permissions ...Permission) (access map[string]bool, err error, code int)
- func (this *ClientImpl) CheckPermission(token string, topicId string, id string, permissions ...Permission) (access bool, err error, code int)
- func (this *ClientImpl) GetResource(token string, topicId string, id string) (result Resource, err error, code int)
- func (this *ClientImpl) GetTopic(token string, id string) (result Topic, err error, code int)
- func (this *ClientImpl) ListAccessibleResourceIds(token string, topicId string, options ListOptions, permissions ...Permission) (ids []string, err error, code int)
- func (this *ClientImpl) ListComputedPermissions(token string, topicId string, ids []string) (result []model.ComputedPermissions, err error, code int)
- func (this *ClientImpl) ListResourcesWithAdminPermission(token string, topicId string, options ListOptions) (result []Resource, err error, code int)
- func (this *ClientImpl) ListTopics(token string, options ListOptions) (result []Topic, err error, code int)
- func (this *ClientImpl) RemoveResource(token string, topicId string, id string) (err error, code int)
- func (this *ClientImpl) RemoveTopic(token string, id string) (err error, code int)
- func (this *ClientImpl) SetPermission(token string, topicId string, id string, permissions ResourcePermissions) (result ResourcePermissions, err error, code int)
- func (this *ClientImpl) SetTopic(token string, topic Topic) (result Topic, err error, code int)
- type GetOptions
- type GroupPermissions
- type ListOptions
- type OpenidToken
- type Permission
- type PermissionList
- type PermissionsMap
- type Resource
- type ResourcePermissions
- type Topic
Constants ¶
View Source
const Administrate = model.Administrate // user may delete resource; user may change resource rights (e.g. delete device)
View Source
const ClientVersion = model.ClientVersion
View Source
const Execute = model.Execute //user may use the resource (e.g. cmd to device; read device data; read database)
View Source
const InternalAdminToken = `` /* 727-byte string literal not displayed */
InternalAdminToken is expired and invalid. but because this service does not validate the received tokens, it may be used by trusted internal services which are within the same network (kubernetes cluster). requests with this token may not be routed over an ingres with token validation
View Source
const Read = model.Read //user may read the resource (metadata) (e.g. read device name)
View Source
const Write = model.Write //user may write the resource (metadata)(e.g. rename device)
Variables ¶
This section is empty.
Functions ¶
func EmbedPermissionsClientIntoRouter ¶ added in v0.0.24
func GenerateGoFileWithSwaggoCommentsForEmbededPermissionsClient ¶ added in v0.0.24
func NewTestClient ¶
func NewTestClient(ctx context.Context) (client *controller.Controller, err error)
func NewTokenProvider ¶
Types ¶
type Client ¶
type Client interface { api.Controller }
type ClientImpl ¶ added in v0.0.11
type ClientImpl struct {
// contains filtered or unexported fields
}
func New ¶
func New(serverUrl string) (client *ClientImpl)
func (*ClientImpl) AdminListResourceIds ¶ added in v0.0.11
func (this *ClientImpl) AdminListResourceIds(token string, topicId string, options ListOptions) (ids []string, err error, code int)
func (*ClientImpl) AdminLoadFromPermissionSearch ¶ added in v0.0.27
func (this *ClientImpl) AdminLoadFromPermissionSearch(req model.AdminLoadPermSearchRequest) (updateCount int, err error, code int)
AdminLoadFromPermissionSearch is not supported by the client because this request should never be automated
func (*ClientImpl) CheckMultiplePermissions ¶ added in v0.0.11
func (this *ClientImpl) CheckMultiplePermissions(token string, topicId string, ids []string, permissions ...Permission) (access map[string]bool, err error, code int)
func (*ClientImpl) CheckPermission ¶ added in v0.0.11
func (this *ClientImpl) CheckPermission(token string, topicId string, id string, permissions ...Permission) (access bool, err error, code int)
func (*ClientImpl) GetResource ¶ added in v0.0.11
func (*ClientImpl) ListAccessibleResourceIds ¶ added in v0.0.11
func (this *ClientImpl) ListAccessibleResourceIds(token string, topicId string, options ListOptions, permissions ...Permission) (ids []string, err error, code int)
func (*ClientImpl) ListComputedPermissions ¶ added in v0.0.15
func (this *ClientImpl) ListComputedPermissions(token string, topicId string, ids []string) (result []model.ComputedPermissions, err error, code int)
func (*ClientImpl) ListResourcesWithAdminPermission ¶ added in v0.0.11
func (this *ClientImpl) ListResourcesWithAdminPermission(token string, topicId string, options ListOptions) (result []Resource, err error, code int)
func (*ClientImpl) ListTopics ¶ added in v0.0.11
func (this *ClientImpl) ListTopics(token string, options ListOptions) (result []Topic, err error, code int)
func (*ClientImpl) RemoveResource ¶ added in v0.0.11
func (*ClientImpl) RemoveTopic ¶ added in v0.0.11
func (this *ClientImpl) RemoveTopic(token string, id string) (err error, code int)
func (*ClientImpl) SetPermission ¶ added in v0.0.11
func (this *ClientImpl) SetPermission(token string, topicId string, id string, permissions ResourcePermissions) (result ResourcePermissions, err error, code int)
SetPermission sets the permissions of a resource. resource initialization needs to be done by an admin; user tokens may update their rights but may not create the initial resource
type GetOptions ¶ added in v0.0.11
type GetOptions = model.GetOptions
type GroupPermissions ¶ added in v0.0.11
type GroupPermissions = model.GroupPermissions
type ListOptions ¶ added in v0.0.11
type ListOptions = model.ListOptions
type OpenidToken ¶
type Permission ¶ added in v0.0.11
type Permission = model.Permission
type PermissionList ¶ added in v0.0.11
type PermissionList = model.PermissionList
type PermissionsMap ¶ added in v0.0.11
type PermissionsMap = model.PermissionsMap
type ResourcePermissions ¶ added in v0.0.11
type ResourcePermissions = model.ResourcePermissions
Click to show internal directories.
Click to hide internal directories.