auth

package
v0.0.0-...-3a7c62b Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: CC-BY-SA-4.0, GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func OauthCallback

func OauthCallback(w http.ResponseWriter, r *http.Request)

func OauthLogin

func OauthLogin(w http.ResponseWriter, r *http.Request)

Types

type Osm

type Osm struct {
	User OsmUser `xml:"user"`
}

Structs when requesting user information

type OsmUser

type OsmUser struct {
	DisplayName string `xml:"display_name,attr"`
	UserId      string `xml:"id,attr"`
}

type Token

type Token struct {
	ValidUntil int64  `json:"valid_until"`
	User       string `json:"user"`
	UID        string `json:"uid"`
	Secret     string `json:"secret"`
}

Struct for authentication

func VerifyRequest

func VerifyRequest(r *http.Request, logger *util.Logger) (*Token, error)

verifyRequest checks the integrity of the token and the "validUntil" date. It then returns the token but without the secret part, just the meta information (e.g. user name) is set.

Jump to

Keyboard shortcuts

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