ory

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package ory provides a high-level client for using Ory Kratos

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Cache clientcache.Cache
}

func (*Cache) GetIdentifierByID

func (c *Cache) GetIdentifierByID(id IdentityID) (IdentityIdentifier, bool, error)

func (*Cache) SetIdentifierByID

func (c *Cache) SetIdentifierByID(
	id IdentityID, identifier IdentityIdentifier, costWeight float32,
) error

func (*Cache) UnsetIdentifierByID

func (c *Cache) UnsetIdentifierByID(id IdentityID)

type Client

type Client struct {
	Config Config
	Ory    *ory.APIClient
	Logger godest.Logger
	Cache  *Cache
}

func NewClient

func NewClient(c Config, cache clientcache.Cache, l godest.Logger) *Client

func (*Client) GetIdentifier

func (c *Client) GetIdentifier(ctx context.Context, id IdentityID) (IdentityIdentifier, error)

func (*Client) GetIdentities

func (c *Client) GetIdentities(ctx context.Context) ([]Identity, error)

func (*Client) GetIdentity

func (c *Client) GetIdentity(ctx context.Context, id IdentityID) (Identity, error)

func (*Client) GetPath

func (c *Client) GetPath(ctx context.Context, endpoint, route string) (string, error)

func (*Client) InitializeLoginFlow

func (c *Client) InitializeLoginFlow(
	ctx context.Context,
) (*ory.SelfServiceLoginFlow, *http.Cookie, error)

func (*Client) PerformLogout

func (c *Client) PerformLogout(
	ctx context.Context, cookies []*http.Cookie,
) ([]*http.Cookie, error)

func (*Client) SubmitLoginFlow

func (c *Client) SubmitLoginFlow(
	ctx context.Context, flow, csrfToken, identifier, password string, cookies []*http.Cookie,
) (*ory.SuccessfulSelfServiceLoginWithoutBrowser, []*http.Cookie, error)

type Config

type Config struct {
	NoAuth            bool
	KratosAPI         *ory.Configuration
	NetworkCostWeight float32
}

func GetConfig

func GetConfig() (c Config, err error)

type Identity

type Identity struct {
	ID         IdentityID
	Identifier IdentityIdentifier
	Email      string
}

type IdentityID added in v0.3.4

type IdentityID string

type IdentityIdentifier added in v0.3.4

type IdentityIdentifier string

Jump to

Keyboard shortcuts

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