@codesoul-co/hypha-tools / secrets
- Package index:
@codesoul-co/hypha-tools - Source:
packages/tools/src/secrets.ts - Exports: 5
Using this module
Use the Secrets module for passing governed secret references and resolution contracts. It exports 5 interfaces.
Import from the package entrypoint
ts
import type {
CredentialLease,
SecretProvider,
SecretResolutionContext,
SecretResolver,
ToolSecretResolver,
} from '@codesoul-co/hypha-tools';Usage patterns
- Use the 5 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
CredentialLease | interface | interface CredentialLease | Credential Lease interface with 5 public fields or methods. |
SecretProvider | interface | interface SecretProvider | Secret Provider interface with 2 public fields or methods. |
SecretResolutionContext | interface | interface SecretResolutionContext | Secret Resolution Context interface with 2 public fields or methods. |
SecretResolver | interface | interface SecretResolver | Provider-neutral boundary for resolving opaque references at the last responsible moment. Implementations must never persist or log lease values. |
ToolSecretResolver | interface | interface ToolSecretResolver | Provider-neutral boundary for resolving opaque references at the last responsible moment. Implementations must never persist or log lease values. |
CredentialLease
Credential Lease interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { CredentialLease } from '@codesoul-co/hypha-tools'; - Source module:
secrets
Declaration
text
export interface CredentialLease {
readonly expiresAt?: string;
readonly renewable: boolean;
read(): string;
renew?(): Promise<CredentialLease>;
release?(): Promise<void>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
expiresAt | property | readonly expiresAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
read | method | read(): string | Public method; parameters and return type are shown in the signature. |
release | method | release?(): Promise<void> | Public method; parameters and return type are shown in the signature. |
renew | method | renew?(): Promise<CredentialLease> | Public method; parameters and return type are shown in the signature. |
renewable | property | readonly renewable: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
SecretProvider
Secret Provider interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { SecretProvider } from '@codesoul-co/hypha-tools'; - Source module:
secrets
Declaration
text
export interface SecretProvider {
readonly scheme: string;
acquire(reference: string, context?: SecretResolutionContext): Promise<CredentialLease | null>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
acquire | method | acquire(reference: string, context?: SecretResolutionContext): Promise<CredentialLease | null> | Public method; parameters and return type are shown in the signature. |
scheme | property | readonly scheme: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
SecretResolutionContext
Secret Resolution Context interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { SecretResolutionContext } from '@codesoul-co/hypha-tools'; - Source module:
secrets
Declaration
text
export interface SecretResolutionContext {
purpose?: 'tool' | 'mcp_authorization' | 'mcp_headers' | 'other';
minimumValidityMs?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
minimumValidityMs | property | minimumValidityMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
purpose | property | purpose?: "tool" | "other" | "mcp_authorization" | "mcp_headers" | Public property; its type, readonly modifier and optionality are shown in the signature. |
SecretResolver
Provider-neutral boundary for resolving opaque references at the last responsible moment. Implementations must never persist or log lease values.
- Kind: interface
- Import:
import type { SecretResolver } from '@codesoul-co/hypha-tools'; - Source module:
secrets
Declaration
text
export interface SecretResolver {
acquire(reference: string, context?: SecretResolutionContext): Promise<CredentialLease | null>;
resolve(reference: string, context?: SecretResolutionContext): Promise<string | null>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
acquire | method | acquire(reference: string, context?: SecretResolutionContext): Promise<CredentialLease | null> | Public method; parameters and return type are shown in the signature. |
resolve | method | resolve(reference: string, context?: SecretResolutionContext): Promise<string | null> | Public method; parameters and return type are shown in the signature. |
ToolSecretResolver
Provider-neutral boundary for resolving opaque references at the last responsible moment. Implementations must never persist or log lease values.
- Kind: interface
- Import:
import type { ToolSecretResolver } from '@codesoul-co/hypha-tools'; - Source module:
secrets
Declaration
text
export interface SecretResolver {
acquire(reference: string, context?: SecretResolutionContext): Promise<CredentialLease | null>;
resolve(reference: string, context?: SecretResolutionContext): Promise<string | null>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
acquire | method | acquire(reference: string, context?: SecretResolutionContext): Promise<CredentialLease | null> | Public method; parameters and return type are shown in the signature. |
resolve | method | resolve(reference: string, context?: SecretResolutionContext): Promise<string | null> | Public method; parameters and return type are shown in the signature. |
