identity_store

package
v0.37.0-dev0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 19 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

View Source
var File_identity_store_identity_store_proto protoreflect.FileDescriptor
View Source
var IdentityStoreSyncService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "identity_store.IdentityStoreSyncService",
	HandlerType: (*IdentityStoreSyncServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CliVersionInformation",
			Handler:    _IdentityStoreSyncService_CliVersionInformation_Handler,
		},
		{
			MethodName: "SyncIdentityStore",
			Handler:    _IdentityStoreSyncService_SyncIdentityStore_Handler,
		},
		{
			MethodName: "GetIdentityStoreMetaData",
			Handler:    _IdentityStoreSyncService_GetIdentityStoreMetaData_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "identity_store/identity_store.proto",
}

IdentityStoreSyncService_ServiceDesc is the grpc.ServiceDesc for IdentityStoreSyncService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var MinimalCliVersion = semver.MustParse("0.33.0-0")

Functions

func RegisterIdentityStoreSyncServiceServer added in v0.32.0

func RegisterIdentityStoreSyncServiceServer(s grpc.ServiceRegistrar, srv IdentityStoreSyncServiceServer)

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 {
	ConfigMap *config.ConfigMap `protobuf:"bytes,1,opt,name=config_map,json=configMap,proto3" json:"config_map,omitempty"`
	UserFile  string            `protobuf:"bytes,2,opt,name=user_file,json=userFile,proto3" json:"user_file,omitempty"`
	GroupFile string            `protobuf:"bytes,3,opt,name=group_file,json=groupFile,proto3" json:"group_file,omitempty"`
	// contains filtered or unexported fields
}

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.

func (*IdentityStoreSyncConfig) Descriptor deprecated added in v0.32.0

func (*IdentityStoreSyncConfig) Descriptor() ([]byte, []int)

Deprecated: Use IdentityStoreSyncConfig.ProtoReflect.Descriptor instead.

func (*IdentityStoreSyncConfig) GetConfigMap added in v0.32.0

func (x *IdentityStoreSyncConfig) GetConfigMap() *config.ConfigMap

func (*IdentityStoreSyncConfig) GetGroupFile added in v0.32.0

func (x *IdentityStoreSyncConfig) GetGroupFile() string

func (*IdentityStoreSyncConfig) GetUserFile added in v0.32.0

func (x *IdentityStoreSyncConfig) GetUserFile() string

func (*IdentityStoreSyncConfig) ProtoMessage added in v0.32.0

func (*IdentityStoreSyncConfig) ProtoMessage()

func (*IdentityStoreSyncConfig) ProtoReflect added in v0.32.0

func (x *IdentityStoreSyncConfig) ProtoReflect() protoreflect.Message

func (*IdentityStoreSyncConfig) Reset added in v0.32.0

func (x *IdentityStoreSyncConfig) Reset()

func (*IdentityStoreSyncConfig) String added in v0.32.0

func (x *IdentityStoreSyncConfig) String() string

type IdentityStoreSyncResult added in v0.15.0

type IdentityStoreSyncResult struct {

	// Deprecated: Do not use.
	Error      *error1.ErrorResult `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	UserCount  int32               `protobuf:"varint,2,opt,name=user_count,json=userCount,proto3" json:"user_count,omitempty"`
	GroupCount int32               `protobuf:"varint,3,opt,name=group_count,json=groupCount,proto3" json:"group_count,omitempty"`
	// contains filtered or unexported fields
}

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.

func (*IdentityStoreSyncResult) Descriptor deprecated added in v0.32.0

func (*IdentityStoreSyncResult) Descriptor() ([]byte, []int)

Deprecated: Use IdentityStoreSyncResult.ProtoReflect.Descriptor instead.

func (*IdentityStoreSyncResult) GetError deprecated added in v0.32.0

Deprecated: Do not use.

func (*IdentityStoreSyncResult) GetGroupCount added in v0.37.0

func (x *IdentityStoreSyncResult) GetGroupCount() int32

func (*IdentityStoreSyncResult) GetUserCount added in v0.37.0

func (x *IdentityStoreSyncResult) GetUserCount() int32

func (*IdentityStoreSyncResult) ProtoMessage added in v0.32.0

func (*IdentityStoreSyncResult) ProtoMessage()

func (*IdentityStoreSyncResult) ProtoReflect added in v0.32.0

func (x *IdentityStoreSyncResult) ProtoReflect() protoreflect.Message

func (*IdentityStoreSyncResult) Reset added in v0.32.0

func (x *IdentityStoreSyncResult) Reset()

func (*IdentityStoreSyncResult) String added in v0.32.0

func (x *IdentityStoreSyncResult) String() string

type IdentityStoreSyncServiceClient added in v0.32.0

type IdentityStoreSyncServiceClient interface {
	CliVersionInformation(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*version.CliBuildInformation, error)
	SyncIdentityStore(ctx context.Context, in *IdentityStoreSyncConfig, opts ...grpc.CallOption) (*IdentityStoreSyncResult, error)
	GetIdentityStoreMetaData(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*MetaData, error)
}

IdentityStoreSyncServiceClient is the client API for IdentityStoreSyncService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewIdentityStoreSyncServiceClient added in v0.32.0

func NewIdentityStoreSyncServiceClient(cc grpc.ClientConnInterface) IdentityStoreSyncServiceClient

type IdentityStoreSyncServiceServer added in v0.32.0

type IdentityStoreSyncServiceServer interface {
	CliVersionInformation(context.Context, *emptypb.Empty) (*version.CliBuildInformation, error)
	SyncIdentityStore(context.Context, *IdentityStoreSyncConfig) (*IdentityStoreSyncResult, error)
	GetIdentityStoreMetaData(context.Context, *emptypb.Empty) (*MetaData, error)
	// contains filtered or unexported methods
}

IdentityStoreSyncServiceServer is the server API for IdentityStoreSyncService service. All implementations must embed UnimplementedIdentityStoreSyncServiceServer for forward compatibility

type IdentityStoreSyncer added in v0.15.0

type IdentityStoreSyncer interface {
	version.CliVersionHandler

	SyncIdentityStore(ctx context.Context, config *IdentityStoreSyncConfig) (*IdentityStoreSyncResult, error)
	GetIdentityStoreMetaData(ctx context.Context) (*MetaData, error)
}

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 {
	plugin.Plugin

	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) GRPCClient added in v0.32.0

func (IdentityStoreSyncerPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*IdentityStoreSyncerPlugin) GRPCServer added in v0.32.0

func (p *IdentityStoreSyncerPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

type IdentityStoreSyncerVersionHandler added in v0.33.0

type IdentityStoreSyncerVersionHandler struct {
}

func (*IdentityStoreSyncerVersionHandler) CliVersionInformation added in v0.33.0

type MetaData added in v0.24.0

type MetaData struct {
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"`
	// contains filtered or unexported fields
}

func (*MetaData) Descriptor deprecated added in v0.32.0

func (*MetaData) Descriptor() ([]byte, []int)

Deprecated: Use MetaData.ProtoReflect.Descriptor instead.

func (*MetaData) GetIcon added in v0.32.0

func (x *MetaData) GetIcon() string

func (*MetaData) GetType added in v0.32.0

func (x *MetaData) GetType() string

func (*MetaData) ProtoMessage added in v0.32.0

func (*MetaData) ProtoMessage()

func (*MetaData) ProtoReflect added in v0.32.0

func (x *MetaData) ProtoReflect() protoreflect.Message

func (*MetaData) Reset added in v0.32.0

func (x *MetaData) Reset()

func (*MetaData) String added in v0.32.0

func (x *MetaData) String() string

type UnimplementedIdentityStoreSyncServiceServer added in v0.32.0

type UnimplementedIdentityStoreSyncServiceServer struct {
}

UnimplementedIdentityStoreSyncServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedIdentityStoreSyncServiceServer) CliVersionInformation added in v0.33.0

func (UnimplementedIdentityStoreSyncServiceServer) GetIdentityStoreMetaData added in v0.32.0

func (UnimplementedIdentityStoreSyncServiceServer) SyncIdentityStore added in v0.32.0

type UnsafeIdentityStoreSyncServiceServer added in v0.32.0

type UnsafeIdentityStoreSyncServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeIdentityStoreSyncServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IdentityStoreSyncServiceServer will result in compilation errors.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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