Help us shape the future of Go! Take the 2026 Go Developer Survey

secrets

package
v0.0.0-...-9ec2bbf Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

README

Secret metadata and payload composition

Fetch adds the composition used by OpenStackSDK's get_secret: it always requests the secret's JSON representation and conditionally requests its payload. The existing native Get, GetPayload, user-metadata operations, and Resources contracts remain available. GetPayload returns buffered []byte and closes the native response before returning; payload retrieval and migration explains its separate request and the corrected return type.

FindIdentity(ctx, identity, options...) also provides library-owned ID/name lookup with conditional payload on direct success and metadata-only list fallback. Identity lookup comparison describes shared options, nullable/full-reference matching, duplicate detection, and pagination.

CreateRecord(ctx, options...) returns the input-seeded Resource view and the actual POST response separately, without a metadata or payload GET. Creation comparison explains the same attribute options used for Containers, Orders, and Secrets.

package example

import (
    "context"

    "github.com/gophercloud/gophercloud/v2"
    "github.com/JSYoo5B/go-openstacksdk/keymanager/v1/secrets"
    "github.com/JSYoo5B/go-openstacksdk/resource"
)

func fetchSecret(ctx context.Context, client *gophercloud.ServiceClient) (*secrets.FetchedSecret, error) {
    return secrets.New(client).Fetch(ctx, resource.ID("secret-id"))
}

The first request is GET /secrets/{id} with Accept: application/json. If the exact response key content_types is absent, no payload request follows. An object with default:null also skips payload. Otherwise its exact default key must be a string; missing keys, null/nonobject containers, and other default types return an error with the metadata response body, headers, and status. An empty string is a selected value and sends an empty Accept header.

WithFetchContentType represents a preexisting Python payload_content_type attribute: it wins over the response's default, including malformed content_types. A response's payload_content_type does not select the payload type for that call. WithFetchPayload(false) is an additional Go option that skips selection and the payload request after reading metadata.

package example

import (
    "context"

    "github.com/gophercloud/gophercloud/v2"
    "github.com/JSYoo5B/go-openstacksdk/keymanager/v1/secrets"
    "github.com/JSYoo5B/go-openstacksdk/resource"
)

func fetchBinarySecret(ctx context.Context, client *gophercloud.ServiceClient) (*secrets.FetchedSecret, error) {
    value, err := secrets.New(client).Fetch(ctx, resource.ID("secret-id"),
        secrets.WithFetchContentType("application/octet-stream"),
        secrets.WithFetchHeader("X-Trace", "caller-trace"))
    // value may contain the successful metadata response even when err
    // describes a later selection, payload HTTP/read, or UTF-8 failure.
    return value, err
}

The second request uses the original fixed GET /secrets/{id}/payload URI. Neither a returned id or secret_ref, nor a changed ResourceBase after the metadata request, changes that URI. References in the response are never followed. SecretID records the request identity separately; the metadata Body contains only actual response fields and has no synthesized ID.

FetchedSecret.Body retains original JSON field values, unknown fields, null versus omission, and numbers beyond floating-point precision. Declared typed fields use exact canonical wire keys; case variants are preserved as raw extensions. BitLength and ContentTypes remain raw JSON. Declared string fields reject incompatible JSON types and collapse null/omission to their Go zero value; the raw Body preserves that distinction. Timestamp pointers retain the original string without timestamp parsing.

Payload owns separate bytes, selected Accept, response headers, and status. Only the exact choice text/plain decodes strict UTF-8 into Payload.Text. Parameterized types such as text/plain;charset=utf-8 return bytes, and the payload response's Content-Type never changes this decision. Invalid UTF-8 returns an accepted-response error while retaining the payload bytes and evidence. Metadata headers and payload headers remain separate.

Option Behavior
WithFetchOptions(FetchOpts) Snapshots the optional bool/string pointers at construction and application.
WithFetchContentType(string) Overrides automatic selection, including an explicit empty string.
WithFetchPayload(bool) Defaults to automatic retrieval; false requests only metadata.
WithFetchHeader(key, value) Adds an extra header to both requests, subject to service-header precedence.

Both requests require a configured key-manager client and share its provider, current authentication, HTTP transport, retry policy, and context. The SDK revalidates source configuration after options/name resolution and between the requests. Options and request headers are copied before name lookup; owned options can be reused concurrently after configuring the client. Conflicting case variants of a header are rejected, while equal values are accepted. Configured service headers retain native precedence over per-call extras. Accept, authentication, routing, content, and version headers are owned by the SDK and cannot be set through Fetch extras or ServiceClient.MoreHeaders. Use WithFetchContentType to select the payload representation. Body, query, and argument extensions are unsupported.

An explicit resource.ID performs no resolver HTTP. An explicit resource.Name resolves once through the existing native Secrets collection, then fixes the selected safe single-segment ID. This name convenience is an explicit Go extension; it does not add heuristic ID/name fallback to the pinned get_secret declaration. The native collection's decoder and lookup policy still govern that optional lookup.

OpenStackSDK comparison

Source is pinned to OpenStackSDK ef55d7d1666099f50bf1e1c40b59d7e7b72a51fe: get_secret calls Secret.fetch. The published Barbican secret reference documents root JSON and payload GET success as HTTP 200.

The composition closes the metadata-first selection, fixed URI, and exact UTF-8/bytes behavior for a stateless explicit Go reference. Go deliberately requires HTTP 200 for both phases and preserves native HTTP/transport/context errors. Python's custom fetch omits generic Resource response translation; HTTP failures follow the configured session/adapter policy. Go never retries a successful response because selection or decoding failed.

Python adds payload to a response dictionary and only then updates and cleans the existing mutable resource. Its seed/cache may retain prior values, and its untyped property descriptors accept values outside Go's declared string model. Go returns an owned response snapshot, keeps actual metadata JSON separate from payload, retains raw unknown fields, and returns partial metadata with an error after a later failure. It does not implement mutable Resource cache/dirty state, generic base_path overrides, or payload skip_cache controls. Native Get keeps its own accepted statuses/model behavior; this new helper does not change it. These remaining differences are explicit rather than a claim of complete inherited Resource parity.

The declared get_secret(secret) metadata-plus-conditional-payload getter is reviewed as a go_mapping with these explicit Go differences. Its native neighbors, separate find/list declarations and inherited Resource lifecycle retain their own support reviews; this closes only the named getter contract.

HTTP evidence is in keymanager_secret_fetch_test.go, covering the eight TestKeyManagerSecretFetch contract groups with local HTTP servers and custom transports. This is not a live-cloud test.

Native Get, List, Create, Update and Delete

API.Get, API.List, API.Create, API.Update and API.Delete call the pinned Gophercloud v2.15.0 secret requests unchanged. IDs are joined into secrets/{id} without escaping, so a slash or query delimiter changes the native path.

Method Request Accepted statuses
Get(ctx, id) GET secrets/{id} 200
List(ctx, options...) GET secrets with ListOpts query native pager
Create(ctx, opts, options...) POST secrets with the CreateOpts JSON body 201
Update(ctx, id, opts, options...) PUT secrets/{id} with the raw payload body 204
Delete(ctx, id) DELETE secrets/{id} 202, 204

Secret decodes created, updated and expiration with the native RFC3339-without-zone parser; a null expiration becomes the zero time. Create omits empty fields, formats Expiration without a zone and sends {} for zero options. WithCreateField adds extension JSON but rejects keys that are core CreateOpts fields. The create response usually holds only secret_ref.

Update sends UpdateOpts.Payload as the raw body and maps ContentType and ContentEncoding to headers. WithUpdateHeader adds other headers and rejects the two core header names. List serializes ListOpts (including created/updated/expiration date filters) plus WithListQuery values, follows the body next link exactly as returned (host and path included), stops on an empty secrets page and sends no further page after the caller stops. Other statuses keep the native gophercloud.ErrUnexpectedResponseCode; the SDK adds only resource.OperationError{Resource: "secrets"} context.

Native secret metadata calls

The six native user-metadata calls use secrets/{id}/metadata and secrets/{id}/metadata/{key} with raw, unescaped path segments.

Method Request Accepted statuses Result
GetMetadata(ctx, secretID) GET .../metadata 200 the metadata map
CreateMetadata(ctx, secretID, opts, options...) PUT .../metadata with {"metadata": opts} 201 the whole response map, usually metadata_ref
GetMetadatum(ctx, secretID, key) GET .../metadata/{key} 200 Metadatum{Key, Value}
CreateMetadatum(ctx, secretID, opts, options...) POST .../metadata with {"key", "value"} 201 error only
UpdateMetadatum(ctx, secretID, opts, options...) PUT .../metadata/{opts.Key} with {"key", "value"} 200 the decoded response
DeleteMetadatum(ctx, secretID, key) DELETE .../metadata/{key} 202, 204 error only

CreateMetadata replaces every user-metadata entry. MetadatumOpts requires both Key and Value before HTTP. The With...Field extension options add JSON values but reject keys already in the body; because the typed metadata map is not a generic object envelope, a CreateMetadata extension is added beside metadata instead of inside it. Other statuses keep the native gophercloud.ErrUnexpectedResponseCode under resource.OperationError context.

Documentation

Overview

Code generated by sdkgen from Gophercloud v2.15.0; DO NOT EDIT.

Code generated by sdkgen from Gophercloud v2.15.0; DO NOT EDIT.

Index

Constants

View Source
const CertificateSecret = upstream.CertificateSecret
View Source
const DateFilterGT = upstream.DateFilterGT
View Source
const DateFilterGTE = upstream.DateFilterGTE
View Source
const DateFilterLT = upstream.DateFilterLT
View Source
const DateFilterLTE = upstream.DateFilterLTE
View Source
const OpaqueSecret = upstream.OpaqueSecret
View Source
const PassphraseSecret = upstream.PassphraseSecret
View Source
const PrivateSecret = upstream.PrivateSecret
View Source
const PublicSecret = upstream.PublicSecret
View Source
const SymmetricSecret = upstream.SymmetricSecret

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Resources *resource.Collection[Secret]
	// contains filtered or unexported fields
}

API owns typed operations and their shared resource policies.

func New

func New(client *gophercloud.ServiceClient) *API

func (*API) All

func (a *API) All(ctx context.Context, options ...resource.ListOption) ([]*Secret, error)

func (*API) AllRecords

func (a *API) AllRecords(ctx context.Context, options ...RecordListOption) ([]*FoundSecretRecord, error)

AllRecords collects ListRecords; a terminal error discards partial rows.

func (*API) Create

func (a *API) Create(ctx context.Context, opts CreateOpts, options ...CreateOption) (*Secret, error)

Create invokes the upstream API with library-owned builders and result handling.

func (*API) CreateMetadata

func (a *API) CreateMetadata(ctx context.Context, secretID string, opts MetadataOpts, options ...CreateMetadataOption) (map[string]string, error)

CreateMetadata invokes the upstream API with library-owned builders and result handling.

func (*API) CreateMetadatum

func (a *API) CreateMetadatum(ctx context.Context, secretID string, opts MetadatumOpts, options ...CreateMetadatumOption) error

CreateMetadatum invokes the upstream API with library-owned builders and result handling.

func (*API) CreateRecord

func (a *API) CreateRecord(ctx context.Context, options ...CreateRecordOption) (*CreatedSecret, error)

CreateRecord is the owned mapping of Python create_secret. Native Create retains its existing concrete options, aliases and success-code policy.

func (*API) Delete

func (a *API) Delete(ctx context.Context, id string) error

Delete invokes the upstream API with library-owned builders and result handling.

func (*API) DeleteMetadatum

func (a *API) DeleteMetadatum(ctx context.Context, secretID string, key string) error

DeleteMetadatum invokes the upstream API with library-owned builders and result handling.

func (*API) Fetch

func (a *API) Fetch(ctx context.Context, ref resource.Ref, options ...FetchOption) (*FetchedSecret, error)

Fetch always reads the metadata representation, then conditionally retrieves its payload from the original fixed secret URI. A failure after metadata decoding returns that owned metadata together with the original error. Explicit Name lookup is an additional Go convenience; ID performs no lookup.

func (*API) Find

func (a *API) Find(ctx context.Context, ref resource.Ref, options ...resource.LookupOption) (*Secret, error)

func (*API) FindIdentity

func (a *API) FindIdentity(ctx context.Context, identity string, options ...resource.IdentityFindOption) (*FetchedSecret, error)

FindIdentity uses a strict metadata/payload Fetch for a safe direct identity. Compatible HTTP 400/403/404 may fall back to an all-page metadata-only search. List results never trigger a subsequent secret or payload GET. Response IDs and references are compared passively and never become request targets.

func (*API) FindRecord

func (a *API) FindRecord(ctx context.Context, identity string, options ...FindRecordOption) (*FoundSecretRecord, error)

FindRecord maps the named find_secret flow onto SDK-owned defaults and views. Safe identities attempt metadata plus conditional payload first. Clean HTTP400/403/404 may fall back to a complete, exact ID-or-name list search; fallback rows are metadata-only. HTTP errors are strict by default, unlike pinned Secret.fetch's unchecked custom session.get(...).json() implementation. On failure, including strict logical absence, an optional receipt has Resource=nil and must never be treated as a found Secret. Missing success returns nil,nil.

func (*API) Get

func (a *API) Get(ctx context.Context, id string) (*Secret, error)

Get invokes the upstream API with library-owned builders and result handling.

func (*API) GetMetadata

func (a *API) GetMetadata(ctx context.Context, secretID string) (map[string]string, error)

GetMetadata invokes the upstream API with library-owned builders and result handling.

func (*API) GetMetadatum

func (a *API) GetMetadatum(ctx context.Context, secretID string, key string) (*Metadatum, error)

GetMetadatum invokes the upstream API with library-owned builders and result handling.

func (*API) GetPayload

func (a *API) GetPayload(ctx context.Context, id string, options ...GetPayloadOption) ([]byte, error)

GetPayload invokes the upstream API with library-owned builders and result handling.

func (*API) List

func (a *API) List(ctx context.Context, options ...ListOption) iter.Seq2[*Secret, error]

List invokes the upstream API with library-owned builders and result handling.

func (*API) ListRecords

func (a *API) ListRecords(ctx context.Context, options ...RecordListOption) iter.Seq2[*FoundSecretRecord, error]

ListRecords is the owned Source secrets iterator. It performs no I/O until iteration, returns complete nullable Resource views and literal HTTP proof, and counts raw rows before Body filtering. No member or payload GET is added. Returned RequestID is empty: references are passive values, not fetch routes.

func (*API) RawClient

func (a *API) RawClient() *gophercloud.ServiceClient

func (*API) Remove

func (a *API) Remove(ctx context.Context, ref resource.Ref, options ...resource.LookupOption) error

func (*API) Update

func (a *API) Update(ctx context.Context, id string, opts UpdateOpts, options ...UpdateOption) error

Update invokes the upstream API with library-owned builders and result handling.

func (*API) UpdateMetadatum

func (a *API) UpdateMetadatum(ctx context.Context, secretID string, opts MetadatumOpts, options ...UpdateMetadatumOption) (*Metadatum, error)

UpdateMetadatum invokes the upstream API with library-owned builders and result handling.

func (*API) UpdateRecord

func (a *API) UpdateRecord(ctx context.Context, id string, options ...UpdateRecordOption) (*UpdatedSecretRecord, error)

UpdateRecord implements the string-ID Secret update lane. Unlike Update's raw-payload upload, this sends unwrapped JSON dirty attributes. ID itself is not dirty; no recognized attrs means no PUT and no payload/metadata GET.

func (*API) WaitFor

func (a *API) WaitFor(ctx context.Context, ref resource.Ref, status string, options ...resource.WaitOption) (*Secret, error)

func (*API) WaitForDeletion

func (a *API) WaitForDeletion(ctx context.Context, ref resource.Ref, options ...resource.WaitOption) error

type CreateMetadataOption

type CreateMetadataOption = request.Option[MetadataOpts]

func WithCreateMetadataField

func WithCreateMetadataField(key string, value any) CreateMetadataOption

func WithCreateMetadataOptions

func WithCreateMetadataOptions(value MetadataOpts) CreateMetadataOption

type CreateMetadatumOption

type CreateMetadatumOption = request.Option[MetadatumOpts]

func WithCreateMetadatumField

func WithCreateMetadatumField(key string, value any) CreateMetadatumOption

func WithCreateMetadatumOptions

func WithCreateMetadatumOptions(value MetadatumOpts) CreateMetadatumOption

type CreateOption

type CreateOption = request.Option[CreateOpts]

func WithCreateField

func WithCreateField(key string, value any) CreateOption

func WithCreateOptions

func WithCreateOptions(value CreateOpts) CreateOption

type CreateOpts

type CreateOpts = upstream.CreateOpts

type CreateRecordOption

type CreateRecordOption = keymanagerread.CreateRecordOption

func WithCreateRecordAttribute

func WithCreateRecordAttribute(key string, value any) CreateRecordOption

func WithCreateRecordAttributes

func WithCreateRecordAttributes(value map[string]any) CreateRecordOption

func WithCreateRecordField

func WithCreateRecordField(key string, value any) CreateRecordOption

func WithCreateRecordHeader

func WithCreateRecordHeader(key, value string) CreateRecordOption

func WithCreateRecordOptions

func WithCreateRecordOptions(value CreateRecordOpts) CreateRecordOption

type CreateRecordOpts

type CreateRecordOpts = keymanagerread.CreateRecordOpts

CreateRecordOpts supplies declared source attributes, including explicit nulls.

type CreateResult

type CreateResult = upstream.CreateResult

type CreatedSecret

type CreatedSecret struct {
	Resource, Wire *resource.RawResource
	Envelope       json.RawMessage
	Header         http.Header
	StatusCode     int
	SecretID       *string
}

CreatedSecret keeps seeded attributes separate from actual POST evidence. Convenience IDs and full references are passive values, not request identities.

type DateFilter

type DateFilter = upstream.DateFilter

type DateQuery

type DateQuery = upstream.DateQuery

type DeleteResult

type DeleteResult = upstream.DeleteResult

type FetchOption

type FetchOption = request.Option[FetchOpts]

func WithFetchContentType

func WithFetchContentType(value string) FetchOption

func WithFetchHeader

func WithFetchHeader(key, value string) FetchOption

func WithFetchOptions

func WithFetchOptions(value FetchOpts) FetchOption

func WithFetchPayload

func WithFetchPayload(value bool) FetchOption

type FetchOpts

type FetchOpts struct {
	Payload     *bool
	ContentType *string
}

FetchOpts controls composition. Nil Payload selects the automatic payload behavior; nil ContentType selects the response's content_types.default. An explicit empty ContentType remains an explicit (empty) Accept value.

type FetchedPayload

type FetchedPayload struct {
	Body       []byte
	Text       *string
	Accept     string
	Header     http.Header
	StatusCode int
}

FetchedPayload owns the exact payload response bytes and HTTP evidence. Text is populated only for an explicitly selected, valid UTF-8 text/plain response. Accept records the choice; response Content-Type cannot change it.

type FetchedSecret

type FetchedSecret struct {
	resource.Metadata
	SecretID               string          `json:"-"`
	Name                   string          `json:"name"`
	Status                 string          `json:"status"`
	SecretRef              string          `json:"secret_ref"`
	Algorithm              string          `json:"algorithm"`
	Mode                   string          `json:"mode"`
	SecretType             string          `json:"secret_type"`
	BitLength              json.RawMessage `json:"bit_length"`
	ContentTypes           json.RawMessage `json:"content_types"`
	ExpiresAt              *string         `json:"expiration"`
	CreatedAt              *string         `json:"created"`
	UpdatedAt              *string         `json:"updated"`
	PayloadContentType     *string         `json:"payload_content_type"`
	PayloadContentEncoding *string         `json:"payload_content_encoding"`
	Payload                *FetchedPayload `json:"-"`
}

FetchedSecret separates the actual metadata response from the payload. SecretID is the fixed request identity, not a fabricated response field. Body keeps original canonical and extension fields, including null/omission.

func (*FetchedSecret) UnmarshalJSON

func (value *FetchedSecret) UnmarshalJSON(data []byte) error

type FindRecordOption

type FindRecordOption func(*FindRecordOpts) error

func WithFindRecordFallback

func WithFindRecordFallback(value resource.FindFallbackPolicy) FindRecordOption

func WithFindRecordIgnoreMissing

func WithFindRecordIgnoreMissing(value bool) FindRecordOption

func WithFindRecordOptions

func WithFindRecordOptions(value FindRecordOpts) FindRecordOption

type FindRecordOpts

type FindRecordOpts struct {
	IgnoreMissing *bool
	Fallback      resource.FindFallbackPolicy
}

FindRecordOpts owns the finite find_secret controls. IgnoreMissing defaults to true; Fallback defaults to compatible clean HTTP400/403/404 fallback. The SDK always checks HTTP status, including Secret's custom payload fetch.

type FoundSecretRecord

type FoundSecretRecord struct {
	RequestID      string
	Resource, Wire *resource.RawResource
	Envelope       json.RawMessage
	Header         http.Header
	StatusCode     int
	Payload        *FetchedPayload
}

FoundSecretRecord keeps the Source descriptor view separate from the actual metadata row and complete HTTP envelope. RequestID is populated only by the direct read. Payload holds actual bytes/headers/status, never a followed ref. Binary payload bytes are JSON base64 in Resource and exact bytes in Payload.

type GetPayloadOption

type GetPayloadOption = request.Option[GetPayloadOpts]

func WithGetPayloadHeader

func WithGetPayloadHeader(key, value string) GetPayloadOption

func WithGetPayloadOptions

func WithGetPayloadOptions(value GetPayloadOpts) GetPayloadOption

type GetPayloadOpts

type GetPayloadOpts = upstream.GetPayloadOpts

type GetResult

type GetResult = upstream.GetResult

type ListOption

type ListOption = request.Option[ListOpts]

func WithListOptions

func WithListOptions(value ListOpts) ListOption

func WithListQuery

func WithListQuery(key, value string) ListOption

type ListOpts

type ListOpts = upstream.ListOpts

type MetadataCreateResult

type MetadataCreateResult = upstream.MetadataCreateResult

type MetadataOpts

type MetadataOpts = upstream.MetadataOpts

type MetadataResult

type MetadataResult = upstream.MetadataResult

type Metadatum

type Metadatum = upstream.Metadatum

type MetadatumCreateResult

type MetadatumCreateResult = upstream.MetadatumCreateResult

type MetadatumDeleteResult

type MetadatumDeleteResult = upstream.MetadatumDeleteResult

type MetadatumOpts

type MetadatumOpts = upstream.MetadatumOpts

type MetadatumResult

type MetadatumResult = upstream.MetadatumResult

type PayloadResult

type PayloadResult = upstream.PayloadResult

type RecordListOption

type RecordListOption func(*RecordListOpts) error

func WithRecordListHeaders

func WithRecordListHeaders(values map[string]string) RecordListOption

func WithRecordListMaxItems

func WithRecordListMaxItems(value int) RecordListOption

func WithRecordListMicroversion

func WithRecordListMicroversion(value string) RecordListOption

func WithRecordListOpts

func WithRecordListOpts(value RecordListOpts) RecordListOption

func WithRecordListPaginated

func WithRecordListPaginated(value bool) RecordListOption

func WithRecordListQuery

func WithRecordListQuery(key string, value any) RecordListOption

WithRecordListQuery follows the finite Source query/Body declaration. Unknown kwargs are discarded, not promoted to wire extensions or caller predicates.

type RecordListOpts

type RecordListOpts struct {
	Query        map[string]json.RawMessage
	Headers      map[string]string
	Microversion *string
	MaxItems     int
	Paginated    *bool
}

RecordListOpts owns Source kwargs and read controls. Pagination defaults to true, zero MaxItems is unbounded, and nil Microversion retains the selected client's default. An absent default causes no Barbican version discovery.

type Secret

type Secret = upstream.Secret

type SecretPage

type SecretPage = upstream.SecretPage

type SecretType

type SecretType = upstream.SecretType

type UpdateMetadatumOption

type UpdateMetadatumOption = request.Option[MetadatumOpts]

func WithUpdateMetadatumField

func WithUpdateMetadatumField(key string, value any) UpdateMetadatumOption

func WithUpdateMetadatumOptions

func WithUpdateMetadatumOptions(value MetadatumOpts) UpdateMetadatumOption

type UpdateOption

type UpdateOption = request.Option[UpdateOpts]

func WithUpdateHeader

func WithUpdateHeader(key, value string) UpdateOption

func WithUpdateOptions

func WithUpdateOptions(value UpdateOpts) UpdateOption

type UpdateOpts

type UpdateOpts = upstream.UpdateOpts

type UpdateRecordOption

type UpdateRecordOption func(*UpdateRecordOpts) error

func WithUpdateRecordAttribute

func WithUpdateRecordAttribute(key string, value any) UpdateRecordOption

func WithUpdateRecordBasePath

func WithUpdateRecordBasePath(value string) UpdateRecordOption

func WithUpdateRecordHeaders

func WithUpdateRecordHeaders(value map[string]string) UpdateRecordOption

func WithUpdateRecordMicroversion

func WithUpdateRecordMicroversion(value string) UpdateRecordOption

func WithUpdateRecordOpts

func WithUpdateRecordOpts(value UpdateRecordOpts) UpdateRecordOption

type UpdateRecordOpts

type UpdateRecordOpts struct {
	Attributes             map[string]json.RawMessage
	Headers                map[string]string
	Microversion, BasePath *string
	// contains filtered or unexported fields
}

UpdateRecordOpts describes an owned, newly seeded Secret commit. Attributes are Source Body names or wire aliases; unknown ordinary attrs are discarded. Headers/Microversion are explicit Go transport controls. BasePath is a literal path within the selected service; Python printf URI templates are not enabled.

type UpdateResult

type UpdateResult = upstream.UpdateResult

type UpdatedSecretRecord

type UpdatedSecretRecord struct {
	RequestID      string
	Seed, Request  map[string]json.RawMessage
	Resource, Wire *resource.RawResource
	Envelope       json.RawMessage
	Header         http.Header
	StatusCode     int
	Committed      bool
}

UpdatedSecretRecord keeps request seed/body separate from an actual PUT observation. Committed means the accepted HTTP body/Close completed; false never proves that the server did not execute an attempted request. Wire contains only received fields; Resource overlays them onto the seed.

Jump to

Keyboard shortcuts

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