gopowersso

package module
v0.0.0-...-19254da Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 5 Imported by: 3

README

go-powersso

Go client for PowerSSO

Documentation

Index

Constants

View Source
const (
	// LevelAdmin is the user level for administrators
	LevelAdmin string = "admin"
)

Variables

This section is empty.

Functions

func Authorization

func Authorization(secret *string) gin.HandlerFunc

Authorization is a middleware to check if the user is authorized to access the resource

func OnlyAdmin

func OnlyAdmin() gin.HandlerFunc

OnlyAdmin middleware to check if the user is an administrator

func SameUser

func SameUser() gin.HandlerFunc

SameUser validates if the logged in user is the same as the request

Types

type Session

type Session struct {
	SessionID string `json:"session_id"`
	UserID    string `json:"user_id"`
	UserLevel string `json:"user_level"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Email     string `json:"email"`
}

Session models the session data

func GetSession

func GetSession(ctx *gin.Context) *Session

GetSession gets the session data from the context

Jump to

Keyboard shortcuts

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