auth

package
v0.0.0-...-13f148b Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SupertokensHostFlag = "supertokens-host"
	SupertokensPortFlag = "supertokens-port"
)

Variables

This section is empty.

Functions

func HasAuth

func HasAuth(c *gin.Context)

func IsAdmin

func IsAdmin(c *gin.Context) bool

func RegisterFlags

func RegisterFlags(f []cli.Flag) []cli.Flag

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func New

func New(c *cli.Context, cl *http.Client, pg *cs.PG) *Auth

func (*Auth) Init

func (s *Auth) Init() error

func (*Auth) RegisterHandler

func (s *Auth) RegisterHandler(r *gin.Engine)

type ErrorContext

type ErrorContext struct{}

type IsAdminContext

type IsAdminContext struct{}

type IsNewContext

type IsNewContext struct{}

type PatreonCampaignAttributes

type PatreonCampaignAttributes struct {
	IsMonthly bool   `json:"is_monthly"`
	Summary   string `json:"summary"`
}

PatreonCampaignAttributes contains campaign-specific attributes

type PatreonCampaignRelationship

type PatreonCampaignRelationship struct {
	Data  PatreonRelationshipData  `json:"data"`
	Links PatreonRelationshipLinks `json:"links"`
}

PatreonCampaignRelationship represents the campaign relationship

type PatreonIdentityResponse

type PatreonIdentityResponse struct {
	Data     PatreonUser           `json:"data"`
	Included []PatreonIncludedItem `json:"included"`
	Links    PatreonResponseLinks  `json:"links"`
}

PatreonIdentityResponse represents the complete response from Patreon Identity API

type PatreonIncludedItem

type PatreonIncludedItem struct {
	ID         string                    `json:"id"`
	Type       string                    `json:"type"`
	Attributes PatreonCampaignAttributes `json:"attributes"`
}

PatreonIncludedItem represents items in the included array

type PatreonRelationshipData

type PatreonRelationshipData struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

PatreonRelationshipData represents relationship data reference

type PatreonRelationshipLinks struct {
	Related string `json:"related"`
}

PatreonRelationshipLinks contains related resource links

type PatreonResponseLinks struct {
	Self string `json:"self"`
}

PatreonResponseLinks contains response-level links

type PatreonUser

type PatreonUser struct {
	ID            string                   `json:"id"`
	Type          string                   `json:"type"`
	Attributes    PatreonUserAttributes    `json:"attributes"`
	Relationships PatreonUserRelationships `json:"relationships"`
}

PatreonUser represents the main user data from Patreon

type PatreonUserAttributes

type PatreonUserAttributes struct {
	Email    string `json:"email"`
	FullName string `json:"full_name"`
}

PatreonUserAttributes contains user-specific attributes

type PatreonUserRelationships

type PatreonUserRelationships struct {
	Campaign PatreonCampaignRelationship `json:"campaign"`
}

PatreonUserRelationships contains related data references

type User

type User struct {
	ID            uuid.UUID
	Email         string
	Expired       bool
	PatreonUserID *string
	IsNew         bool
	Tier          string
}

func GetUserFromContext

func GetUserFromContext(c *gin.Context) *User

func (*User) HasAuth

func (s *User) HasAuth() bool

type UserContext

type UserContext struct{}

Jump to

Keyboard shortcuts

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