authsdk

package module
v0.0.0-...-4e96d3b Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2017 License: Apache-2.0 Imports: 8 Imported by: 2

README

permissions-client

A client SDK for permissions

Documentation

Index

Constants

View Source
const (
	// DefaultApigeeHost is Apigee's default api endpoint host
	DefaultApigeeHost = "https://api.enterprise.apigee.com/"

	// EnvVarApigeeHost is the Env Var to set overide default apigee api host
	EnvVarApigeeHost = "AUTH_API_HOST"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApigeeJWTToken

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

ApigeeJWTToken the apigee impelmentation of the JWT token auth sdk

func (*ApigeeJWTToken) GetEmail

func (token *ApigeeJWTToken) GetEmail() string

GetEmail return the username if possible for the subject

func (*ApigeeJWTToken) GetSubject

func (token *ApigeeJWTToken) GetSubject() string

GetSubject get the subject claim from the token

func (*ApigeeJWTToken) GetUsername

func (token *ApigeeJWTToken) GetUsername() string

GetUsername return the username if possible for the subject

func (*ApigeeJWTToken) IsOrgAdmin

func (token *ApigeeJWTToken) IsOrgAdmin(orgName string) (bool, error)

IsOrgAdmin is the current JWTToken subject an organization admin. If so return true, if not, return false. An error is returned if the check cannot be performed

type JWTToken

type JWTToken interface {

	//GetSubject get the subject claim from the token
	GetSubject() string

	//GetUsername return the username if possible for the subject
	GetUsername() string

	//GetEmail return the username if possible for the subject
	GetEmail() string

	//IsOrgAdmin is the current JWTToken subject an organization admin.  If so return true, if not, return false.  An error is returned if the check cannot be performed
	IsOrgAdmin(orgName string) (bool, error)
}

JWTToken the interface for permissions client

func NewApigeeJWTToken

func NewApigeeJWTToken(token string, c *http.Client) (JWTToken, error)

NewApigeeJWTToken create a new Apigee JWT token. Return the instance or an error if one cannot be created

func NewJWTToken

func NewJWTToken(token string, c *http.Client) (JWTToken, error)

NewJWTToken creates a new JWT token based on the environment configuration

func NewJWTTokenFromRequest

func NewJWTTokenFromRequest(r *http.Request, c *http.Client) (JWTToken, error)

NewJWTTokenFromRequest create and return our JWTToken impl from the http request

func NewTestToken

func NewTestToken(token string) (JWTToken, error)

NewTestToken create a new Apigee JWT token. Return the instance or an error if one cannot be created

type TestJWTToken

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

TestJWTToken the apigee impelmentation of the JWT token auth sdk

func (*TestJWTToken) GetEmail

func (token *TestJWTToken) GetEmail() string

GetEmail return the username if possible for the subject

func (*TestJWTToken) GetSubject

func (token *TestJWTToken) GetSubject() string

GetSubject get the subject claim from the token

func (*TestJWTToken) GetUsername

func (token *TestJWTToken) GetUsername() string

GetUsername return the username if possible for the subject

func (*TestJWTToken) IsOrgAdmin

func (token *TestJWTToken) IsOrgAdmin(orgName string) (bool, error)

IsOrgAdmin is the current JWTToken subject an organization admin. If so return true, if not, return false. An error is returned if the check cannot be performed

Jump to

Keyboard shortcuts

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