api

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGroupWithCleanup

func CreateGroupWithCleanup(client *APIClient, ctx context.Context, config *TestConfig, payload identityopenapi.GroupWrite) (identityopenapi.GroupRead, string)

CreateGroupWithCleanup creates a group and schedules automatic cleanup. Accepts a typed struct for type safety (or use BuildTyped() from the builder).

Types

type APIClient

type APIClient struct {
	*coreclient.APIClient
	// contains filtered or unexported fields
}

APIClient wraps the core API client with identity-specific methods. Add methods here as you write tests for specific endpoints.

func NewAPIClient

func NewAPIClient(baseURL string) (*APIClient, error)

NewAPIClient creates a new Identity API client.

func NewAPIClientWithConfig

func NewAPIClientWithConfig(config *TestConfig) *APIClient

NewAPIClientWithConfig creates a new Identity API client with the given config.

func (*APIClient) CreateGroup

CreateGroup creates a new group in an organization.

func (*APIClient) DeleteGroup

func (c *APIClient) DeleteGroup(ctx context.Context, orgID, groupID string) error

DeleteGroup deletes a group from an organization.

func (*APIClient) GetGlobalACL

func (c *APIClient) GetGlobalACL(ctx context.Context) (*identityopenapi.Acl, error)

GetGlobalACL gets the global ACL for the current user.

func (*APIClient) GetGroup

func (c *APIClient) GetGroup(ctx context.Context, orgID, groupID string) (*identityopenapi.GroupRead, error)

GetGroup gets detailed information about a specific group.

func (*APIClient) GetListOrganizationsPath

func (c *APIClient) GetListOrganizationsPath() string

GetListOrganizationsPath returns the path for listing organizations. This is useful for tests that need direct access to the endpoint path.

func (*APIClient) GetOrganization

func (c *APIClient) GetOrganization(ctx context.Context, orgID string) (*identityopenapi.OrganizationRead, error)

GetOrganization gets detailed information about a specific organization.

func (*APIClient) GetOrganizationACL

func (c *APIClient) GetOrganizationACL(ctx context.Context, orgID string) (*identityopenapi.Acl, error)

GetOrganizationACL gets the ACL for a specific organization.

func (*APIClient) GetProject

func (c *APIClient) GetProject(ctx context.Context, orgID, projectID string) (*identityopenapi.ProjectRead, error)

GetProject gets detailed information about a specific project.

func (*APIClient) GetQuotas

func (c *APIClient) GetQuotas(ctx context.Context, orgID string) (*identityopenapi.QuotasRead, error)

GetQuotas gets the quotas for an organization.

func (*APIClient) ListGroups

func (c *APIClient) ListGroups(ctx context.Context, orgID string) (identityopenapi.Groups, error)

ListGroups lists all groups in an organization.

func (*APIClient) ListOrganizations

func (c *APIClient) ListOrganizations(ctx context.Context) (identityopenapi.Organizations, error)

ListOrganizations lists all organizations.

func (*APIClient) ListProjects

func (c *APIClient) ListProjects(ctx context.Context, orgID string) (identityopenapi.Projects, error)

ListProjects lists all projects in an organization.

func (*APIClient) ListRoles

func (c *APIClient) ListRoles(ctx context.Context, orgID string) (identityopenapi.Roles, error)

ListRoles lists all roles in an organization.

func (*APIClient) ListServiceAccounts

func (c *APIClient) ListServiceAccounts(ctx context.Context, orgID string) (identityopenapi.ServiceAccounts, error)

ListServiceAccounts lists all service accounts in an organization.

func (*APIClient) ListUsers

func (c *APIClient) ListUsers(ctx context.Context, orgID string) (identityopenapi.Users, error)

ListUsers lists all users in an organization.

func (*APIClient) UpdateGroup

func (c *APIClient) UpdateGroup(ctx context.Context, orgID, groupID string, group identityopenapi.GroupWrite) error

UpdateGroup updates an existing group in an organization. Returns nil on success. API returns 200 with empty body.

type Endpoints

type Endpoints struct{}

Endpoints contains API endpoint patterns. Add endpoint methods here as you write tests for them.

func NewEndpoints

func NewEndpoints() *Endpoints

NewEndpoints creates a new Endpoints instance.

func (*Endpoints) GetGlobalACL

func (e *Endpoints) GetGlobalACL() string

GetGlobalACL returns the endpoint for getting global ACL.

func (*Endpoints) GetGroup

func (e *Endpoints) GetGroup(orgID, groupID string) string

GetGroup returns the endpoint for getting a specific group.

func (*Endpoints) GetOrganization

func (e *Endpoints) GetOrganization(orgID string) string

GetOrganization returns the endpoint for getting a specific organization.

func (*Endpoints) GetOrganizationACL

func (e *Endpoints) GetOrganizationACL(orgID string) string

GetOrganizationACL returns the endpoint for getting organization ACL.

func (*Endpoints) GetProject

func (e *Endpoints) GetProject(orgID, projectID string) string

GetProject returns the endpoint for getting a specific project.

func (*Endpoints) GetQuotas

func (e *Endpoints) GetQuotas(orgID string) string

GetQuotas returns the endpoint for getting quotas for an organization.

func (*Endpoints) ListGroups

func (e *Endpoints) ListGroups(orgID string) string

ListGroups returns the endpoint for listing all groups in an organization.

func (*Endpoints) ListOrganizations

func (e *Endpoints) ListOrganizations() string

ListOrganizations returns the endpoint for listing all organizations.

func (*Endpoints) ListProjects

func (e *Endpoints) ListProjects(orgID string) string

ListProjects returns the endpoint for listing all projects in an organization.

func (*Endpoints) ListRoles

func (e *Endpoints) ListRoles(orgID string) string

ListRoles returns the endpoint for listing all roles in an organization.

func (*Endpoints) ListServiceAccounts

func (e *Endpoints) ListServiceAccounts(orgID string) string

ListServiceAccounts returns the endpoint for listing all service accounts in an organization.

func (*Endpoints) ListUsers

func (e *Endpoints) ListUsers(orgID string) string

ListUsers returns the endpoint for listing all users in an organization.

type GinkgoLogger

type GinkgoLogger struct{}

GinkgoLogger implements the Logger interface for Ginkgo tests.

func (*GinkgoLogger) Printf

func (g *GinkgoLogger) Printf(format string, args ...interface{})

type GroupPayloadBuilder

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

GroupPayloadBuilder builds group payloads for testing using type-safe OpenAPI structs.

func NewGroupPayload

func NewGroupPayload() *GroupPayloadBuilder

NewGroupPayload creates a new group payload builder with defaults from config.

func (*GroupPayloadBuilder) BuildTyped

BuildTyped returns the typed group struct directly.

func (*GroupPayloadBuilder) WithName

func (b *GroupPayloadBuilder) WithName(name string) *GroupPayloadBuilder

WithName sets the group name.

func (*GroupPayloadBuilder) WithRoleIDs

func (b *GroupPayloadBuilder) WithRoleIDs(roleIDs []string) *GroupPayloadBuilder

WithRoleIDs sets the role IDs for the group.

func (*GroupPayloadBuilder) WithServiceAccountIDs

func (b *GroupPayloadBuilder) WithServiceAccountIDs(serviceAccountIDs []string) *GroupPayloadBuilder

WithServiceAccountIDs sets the service account IDs for the group.

type TestConfig

type TestConfig struct {
	coreconfig.BaseConfig
	OrgID     string
	ProjectID string
}

TestConfig extends the base config with Identity-specific fields.

func LoadTestConfig

func LoadTestConfig() (*TestConfig, error)

LoadTestConfig loads configuration from environment variables and .env files using viper. Returns an error if required configuration values are missing.

Jump to

Keyboard shortcuts

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