client

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 34 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ConfigFlag = "config"

	Version = "v0alpha0"
)

Variables

View Source
var ErrNoConfig = stderrs.New("no ory configuration file present")
View Source
var ErrNoConfigQuiet = stderrs.New("please run `ory auth` to initialize your configuration or remove the `--quiet` flag")
View Source
var RateLimitHeader = os.Getenv("ORY_RATE_LIMIT_HEADER")

Functions

func CloudAPIsURL added in v0.1.42

func CloudAPIsURL(prefix string) *url.URL

func CloudConsoleURL added in v0.1.42

func CloudConsoleURL(prefix string) *url.URL

func ContextWithClient

func ContextWithClient(ctx context.Context) context.Context

func GetProjectAPIKeyFromEnvironment added in v0.1.41

func GetProjectAPIKeyFromEnvironment() string

GetProjectAPIKeyFromEnvironment returns the project API key from the environment variable.

func NewKratosClient

func NewKratosClient() (*oldCloud.APIClient, error)

func ProjectOrDefault added in v0.2.2

func ProjectOrDefault(cmd *cobra.Command, h *CommandHelper) (string, error)

ProjectOrDefault returns the slug or ID the user set with the `--project` flag, or the default project, or prints a warning and returns an error if none was set.

func ReadConfigFiles

func ReadConfigFiles(files []string) ([]json.RawMessage, error)

func RegisterConfigFlag

func RegisterConfigFlag(f *pflag.FlagSet)

func RegisterProjectFlag

func RegisterProjectFlag(f *flag.FlagSet)

func RegisterYesFlag

func RegisterYesFlag(f *pflag.FlagSet)

Types

type AuthContext

type AuthContext struct {
	Version         string       `json:"version"`
	SessionToken    string       `json:"session_token"`
	SelectedProject uuid.UUID    `json:"selected_project"`
	IdentityTraits  AuthIdentity `json:"session_identity_traits"`
}

func Client added in v0.1.41

func (*AuthContext) Columns

func (i *AuthContext) Columns() []string

func (*AuthContext) Header

func (*AuthContext) Header() []string

func (*AuthContext) ID

func (i *AuthContext) ID() string

func (*AuthContext) Interface

func (i *AuthContext) Interface() interface{}

type AuthIdentity

type AuthIdentity struct {
	ID    uuid.UUID
	Email string `json:"email"`
}

type AuthProject

type AuthProject struct {
	ID   uuid.UUID `json:"id"`
	Slug string    `json:"slug"`
}

type CommandHelper

type CommandHelper struct {
	Ctx              context.Context
	VerboseWriter    io.Writer
	VerboseErrWriter io.Writer
	ConfigLocation   string
	NoConfirm        bool
	IsQuiet          bool
	APIDomain        *url.URL
	Stdin            *bufio.Reader
	PwReader         passwordReader
}

func NewCommandHelper

func NewCommandHelper(cmd *cobra.Command) (*CommandHelper, error)

NewCommandHelper creates a new CommandHelper instance which handles cobra CLI commands.

func (*CommandHelper) Authenticate

func (h *CommandHelper) Authenticate() (*AuthContext, error)

func (*CommandHelper) CreateAPIKey added in v0.1.41

func (h *CommandHelper) CreateAPIKey(projectIdOrSlug, name string) (*cloud.ProjectApiKey, error)

func (*CommandHelper) CreateEventStream added in v0.3.2

func (h *CommandHelper) CreateEventStream(projectID string, body cloud.CreateEventStreamBody) (*cloud.EventStream, error)

func (*CommandHelper) CreateOrganization added in v0.3.0

func (h *CommandHelper) CreateOrganization(projectID string, body cloud.OrganizationBody) (*cloud.Organization, error)

func (*CommandHelper) CreateProject

func (h *CommandHelper) CreateProject(name string, setDefault bool) (*cloud.Project, error)

func (*CommandHelper) DeleteAPIKey added in v0.1.41

func (h *CommandHelper) DeleteAPIKey(projectIdOrSlug, id string) error

func (*CommandHelper) DeleteEventStream added in v0.3.2

func (h *CommandHelper) DeleteEventStream(projectID, streamID string) error

func (*CommandHelper) DeleteOrganization added in v0.3.0

func (h *CommandHelper) DeleteOrganization(projectID, orgID string) error

func (*CommandHelper) EnsureContext

func (h *CommandHelper) EnsureContext() (*AuthContext, error)

func (*CommandHelper) GetDefaultProjectID added in v0.2.2

func (h *CommandHelper) GetDefaultProjectID() string

func (*CommandHelper) GetProject

func (h *CommandHelper) GetProject(projectOrSlug string) (*cloud.Project, error)

func (*CommandHelper) HasValidContext added in v0.1.41

func (h *CommandHelper) HasValidContext() (*AuthContext, bool, error)

func (*CommandHelper) ListEventStreams added in v0.3.2

func (h *CommandHelper) ListEventStreams(projectID string) (*cloud.ListEventStreams, error)

func (*CommandHelper) ListOrganizations added in v0.3.0

func (h *CommandHelper) ListOrganizations(projectID string) (*cloud.ListOrganizationsResponse, error)

func (*CommandHelper) ListProjects

func (h *CommandHelper) ListProjects() ([]cloud.ProjectMetadata, error)

func (*CommandHelper) PatchProject

func (h *CommandHelper) PatchProject(id string, raw []json.RawMessage, add, replace, del []string) (*cloud.SuccessfulProjectUpdate, error)

func (*CommandHelper) PrintUpdateProjectWarnings

func (h *CommandHelper) PrintUpdateProjectWarnings(p *client.SuccessfulProjectUpdate) error

func (*CommandHelper) SetDefaultProject

func (h *CommandHelper) SetDefaultProject(id string) error

func (*CommandHelper) SignOut

func (h *CommandHelper) SignOut() error

func (*CommandHelper) UpdateEventStream added in v0.3.2

func (h *CommandHelper) UpdateEventStream(projectID, streamID string, body cloud.SetEventStreamBody) (*cloud.EventStream, error)

func (*CommandHelper) UpdateOrganization added in v0.3.0

func (h *CommandHelper) UpdateOrganization(projectID, orgID string, body cloud.OrganizationBody) (*cloud.Organization, error)

func (*CommandHelper) UpdateProject

func (h *CommandHelper) UpdateProject(id string, name string, configs []json.RawMessage) (*cloud.SuccessfulProjectUpdate, error)

func (*CommandHelper) WriteConfig

func (h *CommandHelper) WriteConfig(c *AuthContext) error

type PasswordReader

type PasswordReader struct{}

Jump to

Keyboard shortcuts

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