auth

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPlugin

func GetPlugin(name string) func(role, service string, props map[string]string) Auth

GetPlugin return plugin

func InstallPlugin

func InstallPlugin(name string, f func(role, service string, props map[string]string) Auth)

InstallPlugin install auth plugin

Types

type Auth

type Auth interface {
	CheckAuthorization(check *Check) *CheckResult
	GetAPICertification(ak, sk, project string) (*Cert, error)
}

Auth is for 2 cased 1. check source service is authorized or not when try to request micro service 2. Get API service certification from any system

type Cert

type Cert struct {
	Project    string
	AK         string
	ShaAKAndSK string
}

Cert is certification

type Check

type Check struct {
	TargetService           string
	TargetMethod            string
	TargetServiceProperties map[string]string
}

Check includes information to be checked by auth service

type CheckResult

type CheckResult struct {
	Message string
	Err     error
}

CheckResult is returned by auth service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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