auth

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package auth contains the domain concept definitions needed to support Magistrala auth functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL          string        `env:"URL"              envDefault:""`
	Timeout      time.Duration `env:"TIMEOUT"          envDefault:"1s"`
	ClientCert   string        `env:"CLIENT_CERT"      envDefault:""`
	ClientKey    string        `env:"CLIENT_KEY"       envDefault:""`
	ServerCAFile string        `env:"SERVER_CA_CERTS"  envDefault:""`
}

type Handler

type Handler interface {
	// Close closes gRPC connection.
	Close() error

	// Secure is used for pretty printing TLS info.
	Secure() string

	// Connection returns the gRPC connection.
	Connection() *grpc.ClientConn
}

Handler is used to handle gRPC connection.

func Setup

Setup loads Auth gRPC configuration and creates new Auth gRPC client.

For example:

authClient, authHandler, err := auth.Setup(auth.Config{})

func SetupAuthz

func SetupAuthz(cfg Config) (magistrala.AuthzServiceClient, Handler, error)

Setup loads Authz gRPC configuration and creates new Authz gRPC client.

For example:

authzClient, authzHandler, err := auth.Setup(auth.Config{})

Jump to

Keyboard shortcuts

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