organization

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package organization is responsible for OTF organizations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(opts Options) *service

Types

type Authorizer

type Authorizer struct {
	logr.Logger
}

Authorizer authorizes access to an organization

func (*Authorizer) CanAccess

func (a *Authorizer) CanAccess(ctx context.Context, action rbac.Action, name string) (internal.Subject, error)

type Client

type Client struct {
	internal.JSONAPIClient
}

func (*Client) DeleteOrganization

func (c *Client) DeleteOrganization(ctx context.Context, organization string) error

DeleteOrganization deletes an organization via http.

type Entitlements

type Entitlements struct {
	ID                    string
	Agents                bool
	AuditLogging          bool
	CostEstimation        bool
	Operations            bool
	PrivateModuleRegistry bool
	SSO                   bool
	Sentinel              bool
	StateStorage          bool
	Teams                 bool
	VCSIntegrations       bool
}

OTF is free and therefore the user is entitled to all currently supported services.

type Options

type Options struct {
	internal.DB
	*pubsub.Broker
	html.Renderer
	logr.Logger

	RestrictOrganizationCreation bool
}

type Organization

type Organization struct {
	ID              string    `json:"id"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
	Name            string    `json:"name"`
	SessionRemember int       `json:"session_remember"`
	SessionTimeout  int       `json:"session_timeout"`
}

Organization is an OTF organization, comprising workspaces, users, etc.

func NewTestOrganization

func NewTestOrganization(t *testing.T) *Organization

func (*Organization) String

func (org *Organization) String() string

func (*Organization) Update

func (org *Organization) Update(opts OrganizationUpdateOptions) error

type OrganizationList

type OrganizationList struct {
	*internal.Pagination
	Items []*Organization
}

OrganizationList represents a list of Organizations.

type OrganizationListOptions

type OrganizationListOptions struct {
	internal.ListOptions
}

ListOptions represents the options for listing organizations.

type OrganizationPage

type OrganizationPage struct {
	html.SitePage

	Organization string
}

OrganizationPage contains data shared by all organization-based pages.

func NewPage

func NewPage(r *http.Request, title, organization string) OrganizationPage

type OrganizationService

type OrganizationService = Service

type OrganizationUpdateOptions

type OrganizationUpdateOptions struct {
	Name            *string
	SessionRemember *int
	SessionTimeout  *int
}

UpdateOptions represents the options for updating an organization.

type Service

type Service interface {
	UpdateOrganization(ctx context.Context, name string, opts OrganizationUpdateOptions) (*Organization, error)
	GetOrganization(ctx context.Context, name string) (*Organization, error)
	ListOrganizations(ctx context.Context, opts OrganizationListOptions) (*OrganizationList, error)
	DeleteOrganization(ctx context.Context, name string) error

	GetEntitlements(ctx context.Context, organization string) (Entitlements, error)
}

Jump to

Keyboard shortcuts

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