auth

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package auth is for user and application authorization logic

Index

Constants

View Source
const BearerTokenType string = "Bearer"

BearerTokenType is used in authorization to access a resource

Variables

This section is empty.

Functions

This section is empty.

Types

type Permission added in v0.43.0

type Permission struct {
	// The unique ID for the Permission.
	ID uuid.UUID `json:"-"`
	// Unique External ID to be given to outside callers.
	ExternalID secure.Identifier `json:"external_id"`
	// A human-readable string which represents a resource (e.g. an HTTP route or document, etc.).
	Resource string `json:"resource"`
	// A string representing the action taken on the resource (e.g. POST, GET, edit, etc.)
	Operation string `json:"operation"`
	// A description of what the permission is granting, e.g. "grants ability to edit a billing document".
	Description string `json:"description"`
	// A boolean denoting whether the permission is active (true) or not (false).
	Active bool `json:"active"`
}

Permission stores an approval of a mode of access to a resource.

type Provider added in v0.39.0

type Provider uint8

Provider defines the provider of authorization (Google, Apple, auth0, etc.)

const (
	Invalid Provider = iota
	Google           // Google
	Apple            // Apple
)

Provider of authorization

The app uses Oauth2 to authorize users with one of the following Providers

func ParseProvider added in v0.43.0

func ParseProvider(s string) Provider

ParseProvider initializes a Provider given a case-insensitive string

func (Provider) String added in v0.39.0

func (p Provider) String() string

type Role added in v0.43.0

type Role struct {
	// The unique ID for the Role.
	ID uuid.UUID `json:"-"`
	// Unique External ID to be given to outside callers.
	ExternalID secure.Identifier `json:"external_id"`
	// A human-readable code which represents the role.
	Code string `json:"role_cd"`
	// A longer description of the role.
	Description string `json:"role_description"`
	// A boolean denoting whether the role is active (true) or not (false).
	Active bool `json:"active"`
}

Role is a job function or title which defines an authority level.

Jump to

Keyboard shortcuts

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