identity

package
v1.16.6 Latest Latest
Warning

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

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

README

Identity

Purpose

pkg/handler/identity is the legacy v1 handler for region identities.

As a handler surface, it is deprecated along with the older nested v1 Kubernetes-service-oriented model. It should not be treated as the future shape of region APIs.

The underlying concept is still important, though. An Identity is the project-scoped service-principal anchor that allows region to wire real cloud resources into a provider such as OpenStack. In that sense it is somewhat analogous to an Azure service principal, even though the surrounding topology is different.

Today, v2 often hides that concept implicitly, most notably by creating a service principal as part of Network v2 creation. So the handler is legacy, but the architectural idea is not.

Current Responsibilities

  • create and list legacy v1 region identities
  • get legacy v1 identities
  • expose provider-specific convenience state on read, especially for OpenStack
  • provide cloud credentials and related provider state to deprecated v1 Kubernetes/CAPO-oriented flows
  • delete identity roots and rely on cascading deletion of dependants

There is no meaningful update lifecycle here in the modern sense. This handler is mainly retained as create/read/delete compatibility surface for the deprecated v1 model.

The OpenStack read path is the most distinctive behaviour:

  • cloud and cloud-config convenience fields
  • user/project IDs
  • server-group ID
  • SSH key name
  • persisted private key material where still present

That is one of the places where provider scaffolding becomes directly user-visible.

Invariants And Guard Rails

  • This package is v1 compatibility surface, not the preferred handler model.
  • Identity is the visible root of the older v1 ownership graph.
  • Deleting an identity uses foreground deletion so dependent resources remain coordinated beneath the visible parent.
  • Region access is enforced via region.CheckAccess during identity generation, preventing callers from creating identities in regions they cannot see.
  • Provider selection and wiring are derived from the selected region during generation rather than trusted blindly from the caller.

Caveats

  • The handler is deprecated, but the resource concept may become relevant again in a cleaner future model.
  • The handler still matters operationally for remaining deprecated v1 Kubernetes flows because it is how those paths obtain cloud credentials and later trigger cleanup.
  • The current v2 network-to-service-principal mapping is effectively 1:1. If project mapping became more explicit again, identity-like resources could simplify handling of project-scoped cloud artefacts such as uploaded images and snapshots.
  • Exposing OpenStack convenience state here is operationally useful, but it also reflects transitional provider-state ownership that the wider system should continue shrinking over time.

TODO

  • Remove this handler surface when the remaining deprecated v1 flows are gone.
  • Revisit whether the underlying service-principal/project-scoping concept should later return as a cleaner explicit v2 API object rather than staying implicit inside other resources.

Cross-Package Context

  • ../README.md documents why this handler is legacy rather than central to the future API model
  • ../network documents the v2 network flow that now creates service principals implicitly
  • ../../apis/unikorn/v1alpha1 documents the Identity and OpenstackIdentity storage contracts

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	common.ClientArgs
}

Client provides a restful API for identities.

func New

func New(clientArgs common.ClientArgs) *Client

New creates a new client.

func (*Client) Create

func (c *Client) Create(ctx context.Context, organizationID, projectID string, request *openapi.IdentityWrite) (*openapi.IdentityRead, error)

Create instantiates a new resource.

func (*Client) CreateRaw added in v1.10.0

func (c *Client) CreateRaw(ctx context.Context, organizationID, projectID string, request *openapi.IdentityWrite) (*unikornv1.Identity, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, organizationID, projectID, identityID string) error

Delete a resource.

func (*Client) Get

func (c *Client) Get(ctx context.Context, organizationID, projectID, identityID string) (*openapi.IdentityRead, error)

Get a resource.

func (*Client) GetRaw

func (c *Client) GetRaw(ctx context.Context, organizationID, projectID, identityID string) (*unikornv1.Identity, error)

GetRaw gives access to the raw Kubernetes resource.

func (*Client) List

func (c *Client) List(ctx context.Context, organizationID string) (openapi.IdentitiesRead, error)

List returns an ordered list of all resources in scope.

Jump to

Keyboard shortcuts

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