auth

package
v5.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TokenProviderPluginSpec = plugins.PluginSpec[*TokenProviderPlugin, AccessTokenProvider]{
	PluginImpl: &TokenProviderPlugin{},
	Handshake: plugin.HandshakeConfig{
		ProtocolVersion:  1,
		MagicCookieKey:   "KAFKACTL_PLUGIN",
		MagicCookieValue: "TOKEN_PROVIDER_PLUGIN",
	},
}

Functions

This section is empty.

Types

type AccessTokenProvider

type AccessTokenProvider interface {
	Token() (string, error)
	Init(options map[string]any, brokers []string) error
}

type TokenProviderPlugin

type TokenProviderPlugin struct {
	Impl AccessTokenProvider
}

func (TokenProviderPlugin) Client

func (TokenProviderPlugin) Client(_ *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*TokenProviderPlugin) Server

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

type TokenProviderRPC

type TokenProviderRPC struct {
	// contains filtered or unexported fields
}

TokenProviderRPC is the rpc implementation i.e. the one that is used by kafkactl

func (*TokenProviderRPC) Init

func (g *TokenProviderRPC) Init(options map[string]any, brokers []string) error

func (*TokenProviderRPC) Token

func (g *TokenProviderRPC) Token() (string, error)

type TokenProviderRPCServer

type TokenProviderRPCServer struct {
	Impl AccessTokenProvider
}

TokenProviderRPCServer is the rpc server, which is a wrapper around the actual plugin implementation

func (*TokenProviderRPCServer) Init

func (s *TokenProviderRPCServer) Init(args map[string]interface{}, _ *interface{}) error

func (*TokenProviderRPCServer) Token

func (s *TokenProviderRPCServer) Token(_ interface{}, resp *string) error

Jump to

Keyboard shortcuts

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