externalsvc

package
v0.0.0-...-28abc36 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package mock_externalsvc is a generated GoMock package.

Index

Constants

View Source
const (
	ExpirationKey   = "exp"
	UserIDKey       = "uid"
	IssuerKey       = "iss"
	JWTIDKey        = "jti"
	AudienceKey     = "aud"
	SessionDuration = 8760 * time.Hour // 1 year
)

Variables

This section is empty.

Functions

func GenerateAPIKeyJWT

func GenerateAPIKeyJWT(userID uint64, jwtID string) (string, error)

func GenerateSessionJWT

func GenerateSessionJWT(userID uint64) (string, error)

func GenerateWebhookJWT

func GenerateWebhookJWT(url string, secret []byte) (string, error)

func New

func New(authToken string) *external

func ParseAPIKeyJWT

func ParseAPIKeyJWT(tokenString string) (uint64, string, error)

func ParseSessionJWT

func ParseSessionJWT(tokenString string) (uint64, error)

Types

type External

type External interface {
	Verify(reg *registrysvc.Registration, resp verification.TaskResponse) (VerificationResults, error)
}

type MockExternal

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

MockExternal is a mock of External interface

func NewMockExternal

func NewMockExternal(ctrl *gomock.Controller) *MockExternal

NewMockExternal creates a new mock instance

func (*MockExternal) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockExternal) Verify

Verify mocks base method

type MockExternalMockRecorder

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

MockExternalMockRecorder is the mock recorder for MockExternal

func (*MockExternalMockRecorder) Verify

func (mr *MockExternalMockRecorder) Verify(reg, r interface{}) *gomock.Call

Verify indicates an expected call of Verify

type VerificationResult

type VerificationResult struct {
	JobID      uint64 `json:"job_id"`
	TaskID     uint64 `json:"task_id"`
	WorkerID   uint64 `json:"worker_id"`
	ResponseID uint64 `json:"response_id"`
	Accepted   bool   `json:"accepted"`
}

func (*VerificationResult) ToVerificationResponse

func (vr *VerificationResult) ToVerificationResponse() verification.VerificationResponse

type VerificationResults

type VerificationResults []VerificationResult

func (VerificationResults) ToVerificationResponses

func (vrs VerificationResults) ToVerificationResponses() verification.VerificationResponses

Jump to

Keyboard shortcuts

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