structs

package
v0.0.0-...-62634f4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ADFSUser

type ADFSUser struct {
	User
	Sub string `json:"sub"`
	UPN string `json:"upn"`
}

ADFSUser Active Directory user record

func (*ADFSUser) PrepareUserData

func (u *ADFSUser) PrepareUserData()

PrepareUserData implement PersonalData interface

type AliData

type AliData struct {
	Sub      string `json:"sub"`
	Username string `json:"username"`
	Nickname string `json:"nickname"`
	Email    string `json:"email"`
	ID       string `json:"ou_id"`
	Phone    string `json:"phone_number"`
	OuName   string `json:"ou_name"`
}

AliData `data` subobject of Alibaba User response https://github.com/Choo57/vouch-proxy-2/issues/344

type AlibabaUser

type AlibabaUser struct {
	User
	Data AliData `json:"data"`
}

AlibabaUser Aliyun

func (*AlibabaUser) PrepareUserData

func (u *AlibabaUser) PrepareUserData()

PrepareUserData implement PersonalData interface

type AzureUser

type AzureUser struct {
	User
	Sub string `json:"sub"`
	UPN string `json:"upn"`
}

AzureUser is a retrieved and authenticated user from Azure AD

func (*AzureUser) PrepareUserData

func (u *AzureUser) PrepareUserData()

PrepareUserData implement PersonalData interface

type Contact

type Contact struct {
	Type     string `json:"type"`
	Value    string `json:"value"`
	Verified bool   `json:"is_verified"`
}

Contact used for OpenStaxUser

type CustomClaims

type CustomClaims struct {
	Claims map[string]interface{}
}

CustomClaims Temporary struct storing custom claims until JWT creation.

type GitHubTeamMembershipState

type GitHubTeamMembershipState struct {
	State string `json:"state"`
}

GitHubTeamMembershipState for GitHub team api call

type GitHubUser

type GitHubUser struct {
	User
	Login   string `json:"login"`
	Picture string `json:"avatar_url"`
}

GitHubUser is a retrieved and authentiacted user from GitHub.

func (*GitHubUser) PrepareUserData

func (u *GitHubUser) PrepareUserData()

PrepareUserData implement PersonalData interface

type GoogleUser

type GoogleUser struct {
	User
	Sub           string `json:"sub"`
	GivenName     string `json:"given_name"`
	FamilyName    string `json:"family_name"`
	Profile       string `json:"profile"`
	Picture       string `json:"picture"`
	EmailVerified bool   `json:"email_verified"`
	Gender        string `json:"gender"`
	HostDomain    string `json:"hd"`
}

GoogleUser is a retrieved and authentiacted user from Google. unused! TODO: see if these should be pointers to the *User object as per https://golang.org/doc/effective_go.html#embedding

func (*GoogleUser) PrepareUserData

func (u *GoogleUser) PrepareUserData()

PrepareUserData implement PersonalData interface

type IndieAuthUser

type IndieAuthUser struct {
	User
	URL string `json:"me"`
}

IndieAuthUser see indieauth.net

func (*IndieAuthUser) PrepareUserData

func (u *IndieAuthUser) PrepareUserData()

PrepareUserData implement PersonalData interface

type NextcloudUser

type NextcloudUser struct {
	User
	Ocs Ocs `json:"ocs"`
}

NextcloudUser User of Nextcloud retreived from ocs endpoint

func (*NextcloudUser) PrepareUserData

func (u *NextcloudUser) PrepareUserData()

PrepareUserData NextcloudUser

type Ocs

type Ocs struct {
	Data struct {
		UserID string `json:"id"`
		Email  string `json:"email"`
	} `json:"data"`
}

Ocs used for NextcloudUser

type OpenStaxUser

type OpenStaxUser struct {
	User
	Contacts []Contact `json:"contact_infos"`
}

OpenStaxUser is a retrieved and authenticated user from OpenStax Accounts

func (*OpenStaxUser) PrepareUserData

func (u *OpenStaxUser) PrepareUserData()

PrepareUserData implement PersonalData interface

type PTokens

type PTokens struct {
	PAccessToken string
	PIdToken     string
}

PTokens provider tokens (from the IdP)

type Site

type Site struct {
	Domain     string `json:"domain"`
	CreatedOn  int64  `json:"createdon"`
	LastUpdate int64  `json:"lastupdate"`
	ID         int    `json:"id" mapstructure:"id"`
}

Site is the basic unit of auth

type Team

type Team struct {
	Name       string   `json:"name" mapstructure:"name"`
	Members    []string `json:"members" mapstructure:"members"` // just the emails
	Sites      []string `json:"sites" mapstructure:"sites"`     // just the domains
	CreatedOn  int64    `json:"createdon" mapstructure:"createdon"`
	LastUpdate int64    `json:"lastupdate" mapstructure:"lastupdate"`
	ID         int      `json:"id" mapstructure:"id"`
}

Team has members and provides acess to sites

type User

type User struct {
	// TODO: set Provider here so that we can pass it to db
	// populated by db (via mapstructure) or from provider (via json)
	// Provider   string `json:"provider",mapstructure:"provider"`
	Username   string `json:"username" mapstructure:"username"`
	Name       string `json:"name" mapstructure:"name"`
	Email      string `json:"email" mapstructure:"email"`
	CreatedOn  int64  `json:"createdon"`
	LastUpdate int64  `json:"lastupdate"`
	// don't populate ID from json https://github.com/Choo57/vouch-proxy-2/issues/185
	ID int `json:"-" mapstructure:"id"`

	TeamMemberships []string
}

User is inherited.

func (*User) PrepareUserData

func (u *User) PrepareUserData()

PrepareUserData implement PersonalData interface

type UserI

type UserI interface {
	PrepareUserData()
}

UserI each *User struct must prepare the data for being placed in the JWT

Jump to

Keyboard shortcuts

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