remote

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package remote is the AuthKit remote SDK: a client that talks to a standalone AuthKit server's management API over HTTP, satisfying the same AuthKit capability interfaces an in-process embedded.Client does (#142). Lean — net/http + encoding/json only, no engine, no pgx.

FIRST slice: authkit.Authorizer. remote.Client marshals each Authorizer call to the management API and re-derives AuthKit sentinel errors from the wire so errors.Is(err, authkit.ErrX) works across the network. The remaining authkit.Client methods grow the same way; this proves the transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a remote-backed AuthKit client.

func New

func New(baseURL, token string) *Client

New builds a remote client for the management API at baseURL, authenticating with a static bearer token (the app→server credential; "" = none).

func (*Client) Can

func (c *Client) Can(ctx context.Context, subjectID, subjectKind, persona, instanceSlug, perm string) (bool, error)

func (*Client) IsUserAllowed

func (c *Client) IsUserAllowed(ctx context.Context, userID string) (bool, error)

func (*Client) ListEffectivePermissions

func (c *Client) ListEffectivePermissions(ctx context.Context, subjectID, subjectKind, persona, instanceSlug string) ([]string, error)

func (*Client) ListRoleSlugsByUserErr

func (c *Client) ListRoleSlugsByUserErr(ctx context.Context, userID string) ([]string, error)

Jump to

Keyboard shortcuts

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