user

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigureArg

type ConfigureArg struct {
	Ml map[string]interface{}
}

ConfigureArg for RPC

type ConfigureReply

type ConfigureReply struct {
	Err error
}

ConfigureReply for RPC

type FindUsersArg

type FindUsersArg struct {
	Ctx                map[interface{}]interface{}
	Query              string
	SkipFetchingGroups bool
}

FindUsersArg for RPC

type FindUsersReply

type FindUsersReply struct {
	User []*userpb.User
	Err  error
}

FindUsersReply for RPC

type GetUserArg

type GetUserArg struct {
	Ctx                map[interface{}]interface{}
	UID                *userpb.UserId
	SkipFetchingGroups bool
}

GetUserArg for RPC

type GetUserByClaimArg

type GetUserByClaimArg struct {
	Ctx                map[interface{}]interface{}
	Claim              string
	Value              string
	SkipFetchingGroups bool
}

GetUserByClaimArg for RPC

type GetUserByClaimReply

type GetUserByClaimReply struct {
	User *userpb.User
	Err  error
}

GetUserByClaimReply for RPC

type GetUserGroupsArg

type GetUserGroupsArg struct {
	Ctx  map[interface{}]interface{}
	User *userpb.UserId
}

GetUserGroupsArg for RPC

type GetUserGroupsReply

type GetUserGroupsReply struct {
	Group []string
	Err   error
}

GetUserGroupsReply for RPC

type GetUserReply

type GetUserReply struct {
	User *userpb.User
	Err  error
}

GetUserReply for RPC

type Manager

type Manager interface {
	plugin.Plugin
	// GetUser returns the user metadata identified by a uid.
	// The groups of the user are omitted if specified, as these might not be required for certain operations
	// and might involve computational overhead.
	GetUser(ctx context.Context, uid *userpb.UserId, skipFetchingGroups bool) (*userpb.User, error)
	// GetUserByClaim returns the user identified by a specific value for a given claim.
	GetUserByClaim(ctx context.Context, claim, value string, skipFetchingGroups bool) (*userpb.User, error)
	// GetUserGroups returns the groups a user identified by a uid belongs to.
	GetUserGroups(ctx context.Context, uid *userpb.UserId) ([]string, error)
	// FindUsers returns all the user objects which match a query parameter.
	FindUsers(ctx context.Context, query string, skipFetchingGroups bool) ([]*userpb.User, error)
}

Manager is the interface to implement to manipulate users.

type ProviderPlugin

type ProviderPlugin struct {
	Impl Manager
}

ProviderPlugin is the implementation of plugin.Plugin so we can serve/consume this.

func (*ProviderPlugin) Client

func (p *ProviderPlugin) Client(b *hcplugin.MuxBroker, c *rpc.Client) (interface{}, error)

Client returns interface implementation for the plugin that communicates to the server end of the plugin

func (*ProviderPlugin) Server

func (p *ProviderPlugin) Server(*hcplugin.MuxBroker) (interface{}, error)

Server returns the RPC Server which serves the methods that the Client calls over net/rpc

type RPCClient

type RPCClient struct{ Client *rpc.Client }

RPCClient is an implementation of Manager that talks over RPC.

func (*RPCClient) Configure

func (m *RPCClient) Configure(ml map[string]interface{}) error

Configure RPCClient configure method

func (*RPCClient) FindUsers

func (m *RPCClient) FindUsers(ctx context.Context, query string, skipFetchingGroups bool) ([]*userpb.User, error)

FindUsers RPCClient FindUsers method

func (*RPCClient) GetUser

func (m *RPCClient) GetUser(ctx context.Context, uid *userpb.UserId, skipFetchingGroups bool) (*userpb.User, error)

GetUser RPCClient GetUser method

func (*RPCClient) GetUserByClaim

func (m *RPCClient) GetUserByClaim(ctx context.Context, claim, value string, skipFetchingGroups bool) (*userpb.User, error)

GetUserByClaim RPCClient GetUserByClaim method

func (*RPCClient) GetUserGroups

func (m *RPCClient) GetUserGroups(ctx context.Context, user *userpb.UserId) ([]string, error)

GetUserGroups RPCClient GetUserGroups method

type RPCServer

type RPCServer struct {
	// This is the real implementation
	Impl Manager
}

RPCServer is the server that RPCClient talks to, conforming to the requirements of net/rpc

func (*RPCServer) Configure

func (m *RPCServer) Configure(args ConfigureArg, resp *ConfigureReply) error

Configure RPCServer Configure method

func (*RPCServer) FindUsers

func (m *RPCServer) FindUsers(args FindUsersArg, resp *FindUsersReply) error

FindUsers RPCServer FindUsers method

func (*RPCServer) GetUser

func (m *RPCServer) GetUser(args GetUserArg, resp *GetUserReply) error

GetUser RPCServer GetUser method

func (*RPCServer) GetUserByClaim

func (m *RPCServer) GetUserByClaim(args GetUserByClaimArg, resp *GetUserByClaimReply) error

GetUserByClaim RPCServer GetUserByClaim method

func (*RPCServer) GetUserGroups

func (m *RPCServer) GetUserGroups(args GetUserGroupsArg, resp *GetUserGroupsReply) error

GetUserGroups RPCServer GetUserGroups method

Directories

Path Synopsis
manager

Jump to

Keyboard shortcuts

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