usthing

package
v0.0.0-...-1feadb0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TokenPath = "./data/usthing-tokens/"

Variables

This section is empty.

Functions

func CheckIfTokenFileExists

func CheckIfTokenFileExists(userId string) bool

func CreateTokenFile

func CreateTokenFile(userId string, data map[string]interface{}) error

func DeleteTokenFile

func DeleteTokenFile(userId string) error

func GetAccessToken

func GetAccessToken(userId string) (string, error)
func GetLoginLink(userId string) (string, error)

func InitializePKCE

func InitializePKCE(userId string) (authhandler.PKCEParams, error)

func ParseUSTHingRedirectURL

func ParseUSTHingRedirectURL(url string) (string, error)

func ReadTokenFile

func ReadTokenFile(userId string) (map[string]interface{}, error)

func SaveTokenFromMicrosoft

func SaveTokenFromMicrosoft(userId string, body map[string]interface{}) error

func UpdateOrAddValueToTokenFile

func UpdateOrAddValueToTokenFile(userId string, newData map[string]interface{}) error

Types

type TokenData

type TokenData struct {
	AccessToken  string `json:"access_token"`
	ExpireMs     int64  `json:"expire_ms"`
	Code         string `json:"code,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
	CodeVerifier string `json:"code_verifier"`
}

func ReadTokenDataFromFile

func ReadTokenDataFromFile(userId string) (TokenData, error)

type UserInfo

type UserInfo struct {
	DisplayName string `json:"displayName"`
	Mail        string `json:"mail"`
}

func GetUserInfoGraphAPI

func GetUserInfoGraphAPI(accessToken string) (UserInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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