Documentation
¶
Overview ¶
Package credentials issues the credential a hosted agent sandbox uses to authenticate to Obot.
The credential authenticates as the agent rather than as its owner, so a compromised sandbox reaches only what that one instance was configured with instead of everything its owner can reach.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Issuer ¶
type Issuer struct {
// contains filtered or unexported fields
}
func (*Issuer) EnsureInstanceCredential ¶
func (i *Issuer) EnsureInstanceCredential(ctx context.Context, instanceID, ownerUserID string) (string, string, error)
EnsureInstanceCredential returns the instance's credential, minting one only when none exists.
The plaintext is kept in Obot's encrypted credential store, mirroring what nanobot agents do, because an API key's secret is not recoverable from its database row. Every reconcile therefore returns the same value and the same version, which is what keeps the desired revision stable; reissuing would change the version and restart the sandbox.
func (*Issuer) RevokeInstanceCredential ¶
RevokeInstanceCredential revokes the key and deletes its stored plaintext. Revocation immediately invalidates a key, so a leaked credential stops working at once rather than waiting for an expiry these keys deliberately do not have.