sdk

package
v0.70.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package sdk provides an embeddable SDK for the Dex OIDC identity provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DexIdP

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

DexIdP wraps the Dex provider with a builder pattern

func New

func New(opts ...Option) (*DexIdP, error)

New creates a new DexIdP instance with the given options

func NewFromConfigFile

func NewFromConfigFile(path string) (*DexIdP, error)

NewFromConfigFile creates a new DexIdP instance from a YAML config file

func NewFromYAMLConfig

func NewFromYAMLConfig(yamlConfig *dex.YAMLConfig) (*DexIdP, error)

NewFromYAMLConfig creates a new DexIdP instance from a YAMLConfig

func (*DexIdP) CreateUser

func (d *DexIdP) CreateUser(ctx context.Context, email, username, password string) (string, error)

CreateUser creates a new user with the given email, username, and password. Returns the encoded user ID in Dex's format.

func (*DexIdP) DeleteUser

func (d *DexIdP) DeleteUser(ctx context.Context, email string) error

DeleteUser removes a user by email

func (*DexIdP) DiscoveryEndpoint

func (d *DexIdP) DiscoveryEndpoint() string

DiscoveryEndpoint returns the OIDC discovery endpoint URL

func (*DexIdP) EnsureDefaultClients

func (d *DexIdP) EnsureDefaultClients(ctx context.Context, dashboardURIs, cliURIs []string) error

EnsureDefaultClients creates the default NetBird OAuth clients

func (*DexIdP) IssuerURL

func (d *DexIdP) IssuerURL() string

IssuerURL returns the OIDC issuer URL

func (*DexIdP) ListUsers

func (d *DexIdP) ListUsers(ctx context.Context) ([]storage.Password, error)

ListUsers returns all users

func (*DexIdP) Start

func (d *DexIdP) Start(ctx context.Context) error

Start initializes and starts the embedded OIDC provider

func (*DexIdP) Stop

func (d *DexIdP) Stop(ctx context.Context) error

Stop gracefully shuts down the provider

func (*DexIdP) Storage

func (d *DexIdP) Storage() storage.Storage

Storage exposes Dex storage for direct user/client/connector management Use storage.Client, storage.Password, storage.Connector directly

type Option

type Option func(*dex.Config)

Option configures a DexIdP instance

func WithDataDir

func WithDataDir(dir string) Option

WithDataDir sets the data directory for storage

func WithDevMode

func WithDevMode(dev bool) Option

WithDevMode enables development mode (allows HTTP)

func WithGRPCAddr

func WithGRPCAddr(addr string) Option

WithGRPCAddr sets the gRPC API address

func WithIssuer

func WithIssuer(issuer string) Option

WithIssuer sets the OIDC issuer URL

func WithPort

func WithPort(port int) Option

WithPort sets the HTTP port

Jump to

Keyboard shortcuts

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