identity_store

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Overview

Package identity_store provides the tooling to build the Raito identity store import files. Simply use the NewIdentityStoreFileCreator function by passing in the config coming from the CLI to create the necessary files. The returned IdentityStoreFileCreator can then be used (using the AddUsers and AddGroups functions) to write the users and groups to the right file. Make sure to call the Close function on the creator at the end (tip: use defer).

Index

Constants

View Source
const IdentityStoreSyncerName = "identityStoreSyncer"

IdentityStoreSyncerName constant should not be used directly when implementing plugins. It's the registration name for the identity store syncer plugin, used by the CLI and the cli-plugin-base library (RegisterPlugins function) to register the plugins.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	ExternalId             string                 `json:"externalId"`
	Name                   string                 `json:"name"`
	DisplayName            string                 `json:"displayName"`
	Description            string                 `json:"description"`
	ParentGroupExternalIds []string               `json:"parentGroupExternalIds"`
	Tags                   map[string]interface{} `json:"tags"`
}

Group represents a user group in the format that is suitable to be imported into a Raito identity store.

type IdentityStoreFileCreator

type IdentityStoreFileCreator interface {
	AddGroups(groups []Group) error
	AddUsers(users []User) error
	Close()
	GetUserCount() int
	GetGroupCount() int
}

IdentityStoreFileCreator describes the interface for easily creating the user and group import files to be imported by the Raito CLI.

func NewIdentityStoreFileCreator

func NewIdentityStoreFileCreator(config *IdentityStoreSyncConfig) (IdentityStoreFileCreator, error)

NewIdentityStoreFileCreator creates a new IdentityStoreFileCreator based on the configuration coming from the Raito CLI.

type IdentityStoreSyncConfig added in v0.15.0

type IdentityStoreSyncConfig struct {
	config.ConfigMap
	UserFile  string
	GroupFile string
}

IdentityStoreSyncConfig represents the configuration that is passed from the CLI to the IdentityStoreSyncer plugin interface. It contains all the necessary configuration parameters for the plugin to function.

type IdentityStoreSyncResult added in v0.15.0

type IdentityStoreSyncResult struct {
	Error *error2.ErrorResult
}

IdentityStoreSyncResult represents the result from the identity store sync process. A potential error is also modeled in here so specific errors remain intact when passed over RPC.

type IdentityStoreSyncer added in v0.15.0

type IdentityStoreSyncer interface {
	SyncIdentityStore(config *IdentityStoreSyncConfig) IdentityStoreSyncResult
}

IdentityStoreSyncer interface needs to be implemented by any plugin that wants to import users and groups into a Raito identity store.

type IdentityStoreSyncerPlugin added in v0.15.0

type IdentityStoreSyncerPlugin struct {
	Impl IdentityStoreSyncer
}

IdentityStoreSyncerPlugin is used on the server (CLI) and client (plugin) side to integrate with the plugin system. A plugin should not be using this directly, but instead depend on the cli-plugin-base library to register the plugins.

func (IdentityStoreSyncerPlugin) Client added in v0.15.0

func (IdentityStoreSyncerPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*IdentityStoreSyncerPlugin) Server added in v0.15.0

func (p *IdentityStoreSyncerPlugin) Server(*plugin.MuxBroker) (interface{}, error)

type User

type User struct {
	ExternalId       string                 `json:"externalId"`
	Name             string                 `json:"name"`
	UserName         string                 `json:"userName"`
	Email            string                 `json:"email"`
	GroupExternalIds []string               `json:"groupExternalIds"`
	Tags             map[string]interface{} `json:"tags"`
}

User represents a user in the format that is suitable to be imported into a Raito identity store.

Jump to

Keyboard shortcuts

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