authorize

package module
v0.0.0-...-efeff4c Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 23 Imported by: 0

README

Authorization handlers on top of Go-ActivityPub storage

This project can be used as a standalone application or as a package from an external project.

Documentation

Index

Constants

View Source
const (
	ID osin.AuthorizeRequestType = "id"
)

Variables

View Source
var AnonymousAcct = account{
	// contains filtered or unexported fields
}

Functions

func ByName

func ByName(names ...string) url.Values

func ByType

func ByType(types ...vocab.ActivityVocabularyType) url.Values

func ByURL

func ByURL(urls ...vocab.IRI) url.Values

func IRIWithFilters

func IRIWithFilters(iri vocab.IRI, searchParams ...url.Values) vocab.IRI

func IndieAuthClientActor

func IndieAuthClientActor(author vocab.Item, url *url.URL) *vocab.Actor

func SearchActorsIRI

func SearchActorsIRI(baseIRI vocab.IRI, searchParams ...url.Values) vocab.IRI

Types

type ClientLister

type ClientLister interface {
	// ListClients lists existing clients
	ListClients() ([]osin.Client, error)
	GetClient(id string) (osin.Client, error)
}

type ClientSaver

type ClientSaver interface {
	// UpdateClient updates the client (identified by it's id) and replaces the values with the values of client.
	UpdateClient(c osin.Client) error
	// CreateClient stores the client in the database and returns an error, if something went wrong.
	CreateClient(c osin.Client) error
	// RemoveClient removes a client (identified by id) from the database. Returns an error if something went wrong.
	RemoveClient(id string) error
}

type OAuth

type OAuth struct {
	Provider     string
	Code         string
	Token        string
	RefreshToken string
	TokenType    string
	Expiry       time.Time
	State        string
}

type PasswordChanger

type PasswordChanger interface {
	PasswordSet(vocab.Item, []byte) error
	PasswordCheck(vocab.Item, []byte) error
}

type Service

type Service struct {
	Stores []FullStorage
	Client client.Basic
	Logger lw.Logger
}

func (*Service) Authorize

func (s *Service) Authorize(w http.ResponseWriter, r *http.Request)

func (*Service) HandleChangePw

func (s *Service) HandleChangePw(w http.ResponseWriter, r *http.Request)

HandleChangePw

func (*Service) HandleError

func (s *Service) HandleError(e error) http.HandlerFunc

func (Service) IsValidRequest

func (s Service) IsValidRequest(r *http.Request) bool

func (*Service) ShowChangePw

func (s *Service) ShowChangePw(w http.ResponseWriter, r *http.Request)

ShowChangePw

func (*Service) Token

func (s *Service) Token(w http.ResponseWriter, r *http.Request)

func (Service) ValidateClient

func (s Service) ValidateClient(r *http.Request) (*vocab.Actor, error)

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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