auth

package
v0.24.0 Latest Latest
Warning

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

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

README

Auth client

Auth client package is used to identify a thing and authorize a thing's access to a profile.

To identify a thing, you need a valid thing key. You retrieve thing's identity in the form of a thing ID. The latter is used in CRUD operations on things and their connections.

To authorize a thing's access to a profile, you need a valid thing ID and a valid profile ID. If a thing is not connected to a profile, the auth client responds with an error. Otherwise, a nil value is returned, signaling the successful authorization.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Identify(ctx context.Context, thingKey string) (string, error)
	GetPubConfByKey(ctx context.Context, thingKey string) (protomfx.PubConfByKeyRes, error)
}

Client represents Auth cache.

func New

func New(redisClient *redis.Client, things protomfx.ThingsServiceClient) Client

New returns redis profile cache implementation.

Jump to

Keyboard shortcuts

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