token

package
v0.0.0-...-2d73068 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 4 Imported by: 10

Documentation

Overview

Package token provides the services, repositories and types for managing RPT tokens

Index

Constants

View Source
const (
	AuthServiceAccountID = "8f558668-4db7-4280-8e65-408bcb95f9d9"

	Admin              = "fabric8-admin"
	Auth               = "fabric8-auth"
	WIT                = "fabric8-wit"
	OsoProxy           = "fabric8-oso-proxy"
	Tenant             = "fabric8-tenant"
	Notification       = "fabric8-notification"
	JenkinsIdler       = "fabric8-jenkins-idler"
	JenkinsProxy       = "fabric8-jenkins-proxy"
	OnlineRegistration = "online-registration"
	RhChe              = "rh-che"
	GeminiServer       = "fabric8-gemini-server"

	TOKEN_STATUS_DEPROVISIONED = 1
	TOKEN_STATUS_REVOKED       = 2
	TOKEN_STATUS_LOGGED_OUT    = 4
	TOKEN_STATUS_STALE         = 8

	TOKEN_TYPE_RPT     = "RPT"
	TOKEN_TYPE_ACCESS  = "ACC"
	TOKEN_TYPE_REFRESH = "REF"
)

Variables

This section is empty.

Functions

func IsServiceAccount

func IsServiceAccount(ctx context.Context) bool

IsServiceAccount checks if the request is done by a Service account based on the JWT Token provided in context

func IsSpecificServiceAccount

func IsSpecificServiceAccount(ctx context.Context, names ...string) bool

IsSpecificServiceAccount checks if the request is done by a service account listed in the names param based on the JWT Token provided in context

func IsValidTokenType

func IsValidTokenType(tokenType string) bool

IsValidTokenType returns true if the specified token type is one of the known token types, otherwise returns false

Types

type JSONKeys

type JSONKeys struct {
	Keys []interface{} `json:"keys"`
}

JSONKeys the remote keys encoded in a json document

type PrivateKey

type PrivateKey struct {
	KeyID string
	Key   *rsa.PrivateKey
}

PrivateKey represents an RSA private key with a Key ID

type PublicKey

type PublicKey struct {
	KeyID string
	Key   *rsa.PublicKey
}

PublicKey represents an RSA public key with a Key ID

Directories

Path Synopsis
Package repository provides the APIs for making 'token' related database interactions.
Package repository provides the APIs for making 'token' related database interactions.
Package service encapsulates the business logic for managing RPT tokens
Package service encapsulates the business logic for managing RPT tokens

Jump to

Keyboard shortcuts

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