Documentation ¶
Index ¶
Constants ¶
View Source
const APIKeyHeaderName = "X-API-Key"
View Source
const SessionCookieName = "heimdall_sessionToken"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type ClientService ¶
type ClientService interface { ListClients(ctx context.Context) ([]store.Client, error) GetClient(ctx context.Context, id uuid.UUID) (store.Client, error) CreateClient(ctx context.Context, client store.NewClient) (store.Client, error) UpdateClient(ctx context.Context, id uuid.UUID, patch store.ClientPatch) (store.Client, error) DeleteClient(ctx context.Context, id uuid.UUID) error ListClientAPIKeys(ctx context.Context, clientID uuid.UUID) ([]store.APIKey, error) GenerateAPIKey(ctx context.Context, newKey store.NewAPIKey) (string, error) DeleteClientAPIKey(ctx context.Context, clientID, keyID uuid.UUID) error }
type Server ¶
type Server struct { Logger level.Logger Router chi.Router // DisableAuth skips all configured auth checks on all routes. This setting // is intended to be used in setup mode to allow initial users and clients // to be created. DisableAuth bool UserService UserService ClientService ClientService AuthService AuthService }
func NewServer ¶
func NewServer() *Server
NewServer builds a new server object with the default middleware and router already configured. This is the typical way that `Server`s should be created to ensure they have everything needed to function.
func (*Server) ListenAndServe ¶
ListenAndServe spins up the server to listen on the provided address. The allowed addresses follow the same rules as `http.ListenAndServe`.
type UserService ¶
type UserService interface { ListUsers(ctx context.Context) ([]store.User, error) GetUser(ctx context.Context, id uuid.UUID) (store.User, error) CreateUser(ctx context.Context, user store.NewUser) (store.User, error) UpdateUser(ctx context.Context, id uuid.UUID, patch store.UserPatch) (store.User, error) DeleteUser(ctx context.Context, id uuid.UUID) error }
Click to show internal directories.
Click to hide internal directories.