contract

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package contract wires the apikey plugin's intent surface into the forge-dashboard contract registry.

The /apikeys list+detail page stays on the auth contributor (it's a platform-level navigation entry, not a plugin-deep-link page). This package only owns the four intent handlers + their manifest declarations. Cross-contributor invocations are name-only on the wire so the auth contributor's manifest can reference apikeys.list without re-declaring it.

handlers.go: API key intent handlers, owned by the apikey plugin.

Phase D.3-batch4 moved these from the auth contributor's handlers_apikeys.go into this package. The /apikeys list+detail route stays declared on the auth contributor's manifest (the route belongs to the platform-level navigation, not to the apikey plugin's own surface); only the intent registrations move. Cross- contributor intent invocations work because the dashboard's contract dispatcher routes by intent name globally — manifest-level declarations are partitioned by contributor for organisation, but the wire dispatch is name-only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(
	d *dispatcher.Dispatcher,
	reg contract.Registry,
	wreg contract.WardenRegistry,
	deps Deps,
) error

Types

type APIKeyDetail

type APIKeyDetail struct {
	APIKeySummary
	AppID            string `json:"appId,omitempty"`
	EnvID            string `json:"envId,omitempty"`
	UserID           string `json:"userId,omitempty"`
	ServiceAccountID string `json:"serviceAccountId,omitempty"`
	PublicKey        string `json:"publicKey,omitempty"`
	UpdatedAt        string `json:"updatedAt"`
}

type APIKeyListResponse

type APIKeyListResponse struct {
	APIKeys []APIKeySummary `json:"apiKeys"`
}

type APIKeySummary

type APIKeySummary struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	KeyPrefix  string   `json:"keyPrefix"`
	Scopes     []string `json:"scopes,omitempty"`
	Revoked    bool     `json:"revoked"`
	ExpiresAt  string   `json:"expiresAt,omitempty"`
	LastUsedAt string   `json:"lastUsedAt,omitempty"`
	CreatedAt  string   `json:"createdAt"`
}

type CreateAPIKeyInput

type CreateAPIKeyInput struct {
	Name   string   `json:"name"`
	UserID string   `json:"userId"`
	Scopes []string `json:"scopes,omitempty"`
}

type CreateAPIKeyResponse

type CreateAPIKeyResponse struct {
	OK        bool   `json:"ok"`
	ID        string `json:"id"`
	KeyPrefix string `json:"keyPrefix"`
	// Secret is the plaintext API key (`ask_<hex>...`). Present only on
	// the create response; subsequent reads omit it.
	Secret string `json:"secret"`
}

CreateAPIKeyResponse carries the plaintext key the user must copy immediately — it's NEVER readable again (the server stores only the hash). The shell shows this in a one-time modal after creation.

type Deps

type Deps struct {
	Engine *authsome.Engine
}

type GetAPIKeyInput

type GetAPIKeyInput struct {
	ID string `json:"id"`
}

type RevokeAPIKeyInput

type RevokeAPIKeyInput struct {
	ID string `json:"id"`
}

Jump to

Keyboard shortcuts

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