validator

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: GPL-3.0 Imports: 6 Imported by: 4

README

Go Report Card

A mockable JWT validator for use with GoAuth2

A GoAuth2 Jwt validator that can plug into a REST service and determine if a JWT is valid for particular service and the user's role

Documentation

Overview

Package validator ...

Package validator ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim struct {
	Role  string
	URL   string
	Scope string
}

Claim Claim

type Client

type Client interface {
	Authorize(r *http.Request, c *Claim, vURL string) bool
}

Client Client

type MockOauthClient

type MockOauthClient struct {
	MockValidate bool
}

MockOauthClient MockOauthClient

func (*MockOauthClient) Authorize

func (o *MockOauthClient) Authorize(r *http.Request, c *Claim, vURL string) bool

Authorize Authorize

func (*MockOauthClient) GetNewClient

func (o *MockOauthClient) GetNewClient() Client

GetNewClient GetNewClient

type OauthClient

type OauthClient struct {
	Proxy gp.Proxy
}

OauthClient OauthClient

func (*OauthClient) Authorize

func (o *OauthClient) Authorize(r *http.Request, c *Claim, vURL string) bool

Authorize Authorize

func (*OauthClient) GetNewClient

func (o *OauthClient) GetNewClient() Client

GetNewClient GetNewClient

type TokenRequest

type TokenRequest struct {
	AccessToken string `json:"accessToken"`
	UserID      string `json:"userId"`
	ClientID    int64  `json:"clientId"`
	Role        string `json:"role"`
	URI         string `json:"url"`
	Scope       string `json:"scope"`
}

TokenRequest TokenRequest

type TokenResponse

type TokenResponse struct {
	Valid bool `json:"valid"`
}

TokenResponse TokenResponse

Jump to

Keyboard shortcuts

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