authentication

package
v0.0.1-dev.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, opts ...client.Option) (*Client, error)

func (*Client) CreateAccountFederationPolicy

func (c *Client) CreateAccountFederationPolicy(ctx context.Context, req CreateAccountFederationPolicyRequest, opts ...call.Option) (*FederationPolicy, error)

Create account federation policy. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) CreateServicePrincipalFederationPolicy

func (c *Client) CreateServicePrincipalFederationPolicy(ctx context.Context, req CreateServicePrincipalFederationPolicyRequest, opts ...call.Option) (*FederationPolicy, error)

Create account federation policy. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) CreateServicePrincipalSecret

func (c *Client) CreateServicePrincipalSecret(ctx context.Context, req CreateServicePrincipalSecretRequest, opts ...call.Option) (*CreateServicePrincipalSecretResponse, error)

Create a secret for the given service principal. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) CreateServicePrincipalSecretProxy

func (c *Client) CreateServicePrincipalSecretProxy(ctx context.Context, req CreateServicePrincipalSecretRequest, opts ...call.Option) (*CreateServicePrincipalSecretResponse, error)

Create a secret for the given service principal.

func (*Client) DeleteAccountFederationPolicy

func (c *Client) DeleteAccountFederationPolicy(ctx context.Context, req DeleteAccountFederationPolicyRequest, opts ...call.Option) error

Delete account federation policy. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) DeleteServicePrincipalFederationPolicy

func (c *Client) DeleteServicePrincipalFederationPolicy(ctx context.Context, req DeleteServicePrincipalFederationPolicyRequest, opts ...call.Option) error

Delete account federation policy. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) DeleteServicePrincipalSecret

func (c *Client) DeleteServicePrincipalSecret(ctx context.Context, req DeleteServicePrincipalSecretRequest, opts ...call.Option) (*DeleteServicePrincipalSecretResponse, error)

Delete a secret from the given service principal. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) DeleteServicePrincipalSecretProxy

func (c *Client) DeleteServicePrincipalSecretProxy(ctx context.Context, req DeleteServicePrincipalSecretRequest, opts ...call.Option) (*DeleteServicePrincipalSecretResponse, error)

Delete a secret from the given service principal.

func (*Client) GetAccountFederationPolicy

func (c *Client) GetAccountFederationPolicy(ctx context.Context, req GetAccountFederationPolicyRequest, opts ...call.Option) (*FederationPolicy, error)

Get account federation policy. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) GetServicePrincipalFederationPolicy

func (c *Client) GetServicePrincipalFederationPolicy(ctx context.Context, req GetServicePrincipalFederationPolicyRequest, opts ...call.Option) (*FederationPolicy, error)

Get account federation policy. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) ListAccountFederationPolicies

func (c *Client) ListAccountFederationPolicies(ctx context.Context, req ListAccountFederationPoliciesRequest, opts ...call.Option) (*ListFederationPoliciesResponse, error)

List account federation policies. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) ListAccountFederationPoliciesIter

func (c *Client) ListAccountFederationPoliciesIter(ctx context.Context, req ListAccountFederationPoliciesRequest, opts ...call.Option) iter.Seq2[*FederationPolicy, error]

ListAccountFederationPoliciesIter returns an iterator that iterates over the results of ListAccountFederationPolicies.

For example:

for item, err := range c.ListAccountFederationPoliciesIter(ctx, ListAccountFederationPoliciesRequest{}) {
  if err != nil {
    return err
  }
  fmt.Println(item)
}

Options opts are passed to each ListAccountFederationPolicies call made by the iterator under the hood.

Callers who need custom pagination logic should use ListAccountFederationPolicies directly.

func (*Client) ListServicePrincipalFederationPolicies

func (c *Client) ListServicePrincipalFederationPolicies(ctx context.Context, req ListServicePrincipalFederationPoliciesRequest, opts ...call.Option) (*ListFederationPoliciesResponse, error)

List account federation policies. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) ListServicePrincipalFederationPoliciesIter

func (c *Client) ListServicePrincipalFederationPoliciesIter(ctx context.Context, req ListServicePrincipalFederationPoliciesRequest, opts ...call.Option) iter.Seq2[*FederationPolicy, error]

ListServicePrincipalFederationPoliciesIter returns an iterator that iterates over the results of ListServicePrincipalFederationPolicies.

For example:

for item, err := range c.ListServicePrincipalFederationPoliciesIter(ctx, ListServicePrincipalFederationPoliciesRequest{}) {
  if err != nil {
    return err
  }
  fmt.Println(item)
}

Options opts are passed to each ListServicePrincipalFederationPolicies call made by the iterator under the hood.

Callers who need custom pagination logic should use ListServicePrincipalFederationPolicies directly.

func (*Client) ListServicePrincipalSecrets

func (c *Client) ListServicePrincipalSecrets(ctx context.Context, req ListServicePrincipalSecretsRequest, opts ...call.Option) (*ListServicePrincipalSecretsResponse, error)

List all secrets associated with the given service principal. This operation only returns information about the secrets themselves and does not include the secret values. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) ListServicePrincipalSecretsIter

func (c *Client) ListServicePrincipalSecretsIter(ctx context.Context, req ListServicePrincipalSecretsRequest, opts ...call.Option) iter.Seq2[*ServicePrincipalSecret, error]

ListServicePrincipalSecretsIter returns an iterator that iterates over the results of ListServicePrincipalSecrets.

For example:

for item, err := range c.ListServicePrincipalSecretsIter(ctx, ListServicePrincipalSecretsRequest{}) {
  if err != nil {
    return err
  }
  fmt.Println(item)
}

Options opts are passed to each ListServicePrincipalSecrets call made by the iterator under the hood.

Callers who need custom pagination logic should use ListServicePrincipalSecrets directly.

func (*Client) ListServicePrincipalSecretsProxy

func (c *Client) ListServicePrincipalSecretsProxy(ctx context.Context, req ListServicePrincipalSecretsRequest, opts ...call.Option) (*ListServicePrincipalSecretsResponse, error)

List all secrets associated with the given service principal. This operation only returns information about the secrets themselves and does not include the secret values.

func (*Client) ListServicePrincipalSecretsProxyIter

func (c *Client) ListServicePrincipalSecretsProxyIter(ctx context.Context, req ListServicePrincipalSecretsRequest, opts ...call.Option) iter.Seq2[*ServicePrincipalSecret, error]

ListServicePrincipalSecretsProxyIter returns an iterator that iterates over the results of ListServicePrincipalSecretsProxy.

For example:

for item, err := range c.ListServicePrincipalSecretsProxyIter(ctx, ListServicePrincipalSecretsRequest{}) {
  if err != nil {
    return err
  }
  fmt.Println(item)
}

Options opts are passed to each ListServicePrincipalSecretsProxy call made by the iterator under the hood.

Callers who need custom pagination logic should use ListServicePrincipalSecretsProxy directly.

func (*Client) UpdateAccountFederationPolicy

func (c *Client) UpdateAccountFederationPolicy(ctx context.Context, req UpdateAccountFederationPolicyRequest, opts ...call.Option) (*FederationPolicy, error)

Update account federation policy. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) UpdateServicePrincipalFederationPolicy

func (c *Client) UpdateServicePrincipalFederationPolicy(ctx context.Context, req UpdateServicePrincipalFederationPolicyRequest, opts ...call.Option) (*FederationPolicy, error)

Update account federation policy. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

type CreateAccountFederationPolicyRequest

type CreateAccountFederationPolicyRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	// The identifier for the federation policy. The identifier must contain only
	// lowercase alphanumeric characters, numbers, hyphens, and slashes. If
	// unspecified, the id will be assigned by <Databricks>.
	PolicyId *string
	Policy   *FederationPolicy
}

type CreateServicePrincipalFederationPolicyRequest

type CreateServicePrincipalFederationPolicyRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	// The identifier for the federation policy. The identifier must contain only
	// lowercase alphanumeric characters, numbers, hyphens, and slashes. If
	// unspecified, the id will be assigned by <Databricks>.
	PolicyId *string
	Policy   *FederationPolicy
}

type CreateServicePrincipalSecretRequest

type CreateServicePrincipalSecretRequest struct {
	// The account ID.
	AccountId *string
	// The service principal ID.
	ServicePrincipal *string
	// The lifetime of the secret in seconds. If this parameter is not provided, the
	// secret will have a default lifetime of 730 days (63072000s).
	Lifetime *types.Duration
}

type CreateServicePrincipalSecretResponse

type CreateServicePrincipalSecretResponse struct {
	// ID of the secret
	Id *string
	// Secret Value
	Secret *string
	// Secret Hash
	SecretHash *string
	// UTC time when the secret was created
	CreateTime *string
	// UTC time when the secret was updated
	UpdateTime *string
	// Status of the secret
	Status *string
	// UTC time when the secret will expire. If the field is not present, the secret
	// does not expire.
	ExpireTime *types.Time
}

type DeleteAccountFederationPolicyRequest

type DeleteAccountFederationPolicyRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	// The identifier for the federation policy.
	PolicyId *string
}

type DeleteServicePrincipalFederationPolicyRequest

type DeleteServicePrincipalFederationPolicyRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	// The identifier for the federation policy.
	PolicyId *string
}

type DeleteServicePrincipalSecretRequest

type DeleteServicePrincipalSecretRequest struct {
	// The account ID.
	AccountId *string
	// The service principal ID.
	ServicePrincipal *string
	// The secret ID.
	SecretId *string
}

type DeleteServicePrincipalSecretResponse

type DeleteServicePrincipalSecretResponse struct {
}

type FederationPolicy

type FederationPolicy struct {
	// Resource name for the federation policy. Example values include
	// `accounts/<account-id>/federationPolicies/my-federation-policy` for Account
	// Federation Policies, and
	// `accounts/<account-id>/servicePrincipals/<service-principal-id>/federationPolicies/my-federation-policy`
	// for Service Principal Federation Policies. Typically an output parameter,
	// which does not need to be specified in create or update requests. If
	// specified in a request, must match the value in the request URL.
	Name *string `fieldmask:"name"`
	// Description of the federation policy.
	Description *string `fieldmask:"description"`
	Policy      isFederationPolicy_Policy
	// Creation time of the federation policy.
	CreateTime *types.Time `fieldmask:"create_time"`
	// Last update time of the federation policy.
	UpdateTime *types.Time `fieldmask:"update_time"`
	// Unique, immutable id of the federation policy.
	Uid *string `fieldmask:"uid"`
	// The service principal ID that this federation policy applies to. Output only.
	// Only set for service principal federation policies.
	ServicePrincipalId *int64 `fieldmask:"service_principal_id"`
	// The ID of the federation policy. Output only.
	PolicyId *string `fieldmask:"policy_id"`
	// contains filtered or unexported fields
}

type FederationPolicy_Policy_OidcPolicy

type FederationPolicy_Policy_OidcPolicy struct {
	OidcPolicy OidcFederationPolicy `fieldmask:"oidc_policy"`
}

FederationPolicy_Policy_OidcPolicy selects OidcPolicy for FederationPolicy.Policy.

type GetAccountFederationPolicyRequest

type GetAccountFederationPolicyRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	// The identifier for the federation policy.
	PolicyId *string
}

type GetServicePrincipalFederationPolicyRequest

type GetServicePrincipalFederationPolicyRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	// The identifier for the federation policy.
	PolicyId *string
}

type ListAccountFederationPoliciesRequest

type ListAccountFederationPoliciesRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	PageSize           *int
	PageToken          *string
}

type ListFederationPoliciesResponse

type ListFederationPoliciesResponse struct {
	Policies      []FederationPolicy
	NextPageToken *string
}

type ListServicePrincipalFederationPoliciesRequest

type ListServicePrincipalFederationPoliciesRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	PageSize           *int
	PageToken          *string
}

type ListServicePrincipalSecretsRequest

type ListServicePrincipalSecretsRequest struct {
	// The account ID.
	AccountId *string
	// The service principal ID.
	ServicePrincipal *string
	// An opaque page token which was the `next_page_token` in the response of the
	// previous request to list the secrets for this service principal. Provide this
	// token to retrieve the next page of secret entries. When providing a
	// `page_token`, all other parameters provided to the request must match the
	// previous request. To list all of the secrets for a service principal, it is
	// necessary to continue requesting pages of entries until the response contains
	// no `next_page_token`. Note that the number of entries returned must not be
	// used to determine when the listing is complete.
	PageToken *string
	PageSize  *int
}

type ListServicePrincipalSecretsResponse

type ListServicePrincipalSecretsResponse struct {
	// List of the secrets
	Secrets []ServicePrincipalSecret
	// A token, which can be sent as `page_token` to retrieve the next page.
	NextPageToken *string
}

type OidcFederationPolicy

type OidcFederationPolicy struct {
	// The required token issuer, as specified in the 'iss' claim of federated
	// tokens.
	Issuer *string `fieldmask:"issuer"`
	// The required token subject, as specified in the subject claim of federated
	// tokens. Must be specified for service principal federation policies. Must not
	// be specified for account federation policies.
	Subject *string `fieldmask:"subject"`
	// The allowed token audiences, as specified in the 'aud' claim of federated
	// tokens. The audience identifier is intended to represent the recipient of the
	// token. Can be any non-empty string value. As long as the audience in the
	// token matches at least one audience in the policy, the token is considered a
	// match. If audiences is unspecified, defaults to your <Databricks> account id.
	Audiences []string `fieldmask:"audiences"`
	// The claim that contains the subject of the token. If unspecified, the default
	// value is 'sub'.
	SubjectClaim *string `fieldmask:"subject_claim"`
	// URL of the public keys used to validate the signature of federated tokens, in
	// JWKS format. Most use cases should not need to specify this field. If
	// jwks_uri and jwks_json are both unspecified (recommended), <Databricks>
	// automatically fetches the public keys from your issuer’s well known
	// endpoint. Databricks strongly recommends relying on your issuer’s well
	// known endpoint for discovering public keys.
	JwksUri *string `fieldmask:"jwks_uri"`
	// The public keys used to validate the signature of federated tokens, in JWKS
	// format. Most use cases should not need to specify this field. If jwks_uri and
	// jwks_json are both unspecified (recommended), <Databricks> automatically
	// fetches the public keys from your issuer’s well known endpoint. Databricks
	// strongly recommends relying on your issuer’s well known endpoint for
	// discovering public keys.
	JwksJson *string `fieldmask:"jwks_json"`
}

Specifies the policy to use for validating OIDC claims in your federated tokens..

type ServicePrincipalSecret

type ServicePrincipalSecret struct {
	// ID of the secret
	Id *string
	// Secret Value
	Secret *string
	// Secret Hash
	SecretHash *string
	// UTC time when the secret was created
	CreateTime *string
	// UTC time when the secret was updated
	UpdateTime *string
	// Status of the secret
	Status *string
	// UTC time when the secret will expire. If the field is not present, the secret
	// does not expire.
	ExpireTime *types.Time
}

type UpdateAccountFederationPolicyRequest

type UpdateAccountFederationPolicyRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	// The identifier for the federation policy.
	PolicyId *string
	Policy   *FederationPolicy
	// The field mask specifies which fields of the policy to update. To specify
	// multiple fields in the field mask, use comma as the separator (no space). The
	// special value '*' indicates that all fields should be updated (full
	// replacement). If unspecified, all fields that are set in the policy provided
	// in the update request will overwrite the corresponding fields in the existing
	// policy. Example value: 'description,oidc_policy.audiences'.
	UpdateMask *types.FieldMask[FederationPolicy]
}

type UpdateServicePrincipalFederationPolicyRequest

type UpdateServicePrincipalFederationPolicyRequest struct {
	// The account id for the federation policy.
	AccountId *string
	// The service principal id for the federation policy.
	ServicePrincipalId *int64
	// The identifier for the federation policy.
	PolicyId *string
	Policy   *FederationPolicy
	// The field mask specifies which fields of the policy to update. To specify
	// multiple fields in the field mask, use comma as the separator (no space). The
	// special value '*' indicates that all fields should be updated (full
	// replacement). If unspecified, all fields that are set in the policy provided
	// in the update request will overwrite the corresponding fields in the existing
	// policy. Example value: 'description,oidc_policy.audiences'.
	UpdateMask *types.FieldMask[FederationPolicy]
}

Jump to

Keyboard shortcuts

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