grpc_adapter

package
v0.0.0-...-7df4224 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckToken

func CheckToken(tokenStr string) (bool, error)

Types

type AuthCheckAdapter

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

AuthCheckAdapter supports metric template.

func (*AuthCheckAdapter) Addr

func (s *AuthCheckAdapter) Addr() string

Addr returns the listening address of the server

func (*AuthCheckAdapter) Close

func (s *AuthCheckAdapter) Close() error

Close gracefully shuts down the server; used for testing

func (*AuthCheckAdapter) HandleAuthorization

HandleAuthorization - Perform the authorization check.

func (*AuthCheckAdapter) Run

func (s *AuthCheckAdapter) Run(shutdown chan error)

Run starts the server run

type AuthResult

type AuthResult struct {
	Message struct {
		Error            string `json:"error"`
		ErrorDescription string `json:"error_description"`
	} `json:"message,omitempty"`
	Result     string `json:"result"`
	Expiration int64  `json:"expiration"`
}

type Server

type Server interface {
	Addr() string
	Close() error
	Run(shutdown chan error)
}

Server is basic server interface

func NewAuthCheckAdapter

func NewAuthCheckAdapter(addr string) (Server, error)

NewAuthCheckAdapter creates a new IBP adapter that listens at provided port.

type ServerAClaims

type ServerAClaims struct {
	Roles     []string `json:"roles"`
	AuthToken string   `json:"auth_token"`
	jwt.StandardClaims
}

The ServerAClaims is used as the claims portion of the JWT.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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