broker

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowedScopes = []string{
	"user:manage:*",
	"team:manage:*",
	"user:invite",
	"system_account:manage:*",
	"system_account:read:*",
	"user:read:*",
	"team:read:*",
	"contract_data:manage:*",
	"contract_data:read:*",
	"contract_data:bulk_delete:*",
	"webhook:manage:*",
	"secret:manage:*",
	"role:manage:*",
	"role:read:*",
	"token:manage:own",
	"read_token:manage:own",
}

Functions

This section is empty.

Types

type APIToken

type APIToken struct {
	UUID        string `json:"uuid,omitempty"`
	Description string `json:"description,omitempty"`
	Value       string `json:"value,omitempty"`
}

APIToken represents an individual API token

type APITokenResponse

type APITokenResponse struct {
	APIToken
	HalDoc
}

APITokenResponse is the response body for any CRU API calls

type APITokensEmbedded

type APITokensEmbedded struct {
	Items []APIToken `json:"items"`
}

APITokensEmbedded contains the embedded links in the resource

type APITokensResponse

type APITokensResponse struct {
	Embedded APITokensEmbedded `json:"_embedded"`
	HalDoc
}

APITokensResponse is the response body for List API calls

type AuthenticationProviders

type AuthenticationProviders struct {
	Google GoogleAuthenticationSettings `json:"Google,omitempty"`
	Github GithubAuthenticationSettings `json:"GitHub,omitempty"`
}

AuthenticationProviders for the current tenant

type AuthenticationSettings

type AuthenticationSettings struct {
	Providers AuthenticationProviders `json:"authenticationProviders"`
}

AuthenticationSettings contains Pactflow tenant authentication settings

type EmbeddedUsers

type EmbeddedUsers = struct {
	Users []User `json:"users,omitempty"`
}

type Environment added in v0.3.4

type Environment struct {
	Name        string                   `json:"name,omitempty"`
	Production  bool                     `json:"production"`
	DisplayName string                   `json:"displayName,omitempty"`
	CreatedAt   string                   `json:"createdAt,omitempty"`
	UpdatedAt   string                   `json:"updatedAt,omitempty"`
	UUID        string                   `json:"uuid,omitempty"`
	Embedded    EnvironmentEmbeddedItems `json:"_embedded,omitempty"`
}

Environment represents an environment and application may be deployed to

type EnvironmentCreateOrUpdateRequest added in v0.3.4

type EnvironmentCreateOrUpdateRequest struct {
	UUID        string   `json:"-"`
	DisplayName string   `json:"displayName,omitempty"`
	Name        string   `json:"name,omitempty"`
	Production  bool     `json:"production"`
	Teams       []string `json:"teamUuids"`
}

type EnvironmentCreateOrUpdateResponse added in v0.3.4

type EnvironmentCreateOrUpdateResponse struct {
	Name        string                   `json:"name,omitempty"`
	Production  bool                     `json:"production"`
	DisplayName string                   `json:"displayName,omitempty"`
	CreatedAt   string                   `json:"createdAt,omitempty"`
	UpdatedAt   string                   `json:"updatedAt,omitempty"`
	UUID        string                   `json:"uuid,omitempty"`
	Teams       []string                 `json:"teamUuids"`
	Embedded    EnvironmentEmbeddedItems `json:"_embedded,omitempty"`
}

type EnvironmentEmbeddedItems added in v0.3.4

type EnvironmentEmbeddedItems struct {
	Teams []Team `json:"teams,omitempty"`
}

type GithubAuthenticationSettings

type GithubAuthenticationSettings struct {
	Organizations []string `json:"GithubOrganizations"`
}

GithubAuthenticationSettings configures the allowed organisations that may authenticate to Pactflow NOTE: this does not perform any Github OAuth process, which must be confirmed via the UI after enabling

type GoogleAuthenticationSettings

type GoogleAuthenticationSettings struct {
	EmailDomains []string `json:"EmailDomains"`
}

GoogleAuthenticationSettings configures the allowed email domains to authenticate to Pactflow

type HalDoc

type HalDoc struct {
	Links HalLinks `json:"_links"`
}

HalDoc is a simple representation of the HAL response from a Pact Broker.

type HalLinks map[string]Link

HalLinks represents the _links key in a HAL document.

type Headers

type Headers map[string]string
type Link struct {
	Href  string `json:"href"`
	Title string `json:"title"`
	Name  string `json:"name"`
}

Link represents a link to a resource

type Pacticipant

type Pacticipant struct {
	Name          string `json:"name,omitempty" pact:"example=terraform-client"`
	RepositoryURL string `json:"repositoryUrl,omitempty" pact:"example=https://github.com/pactflow/terraform-provider-pact"`
	MainBranch    string `json:"mainBranch,omitempty" pact:"example=main"`
	DisplayName   string `json:"displayName,omitempty" pact:"example=terraform client"`
}

type PatchResource

type PatchResource struct {
	Uuid string `json:"uuid"`
}

type Permission

type Permission struct {
	Name        string `json:"name,omitempty"`
	Scope       string `json:"scope,omitempty"`
	Label       string `json:"label,omitempty"`
	Description string `json:"description,omitempty"`
}

type Request

type Request struct {
	Method   string      `json:"method,omitempty"`
	URL      string      `json:"url,omitempty"`
	Username string      `json:"username,omitempty"`
	Password string      `json:"password,omitempty"`
	Headers  Headers     `json:"headers,omitempty"`
	Body     interface{} `json:"body,omitempty"`
}

Request is an HTTP request structure

type Role

type Role struct {
	UUID        string       `json:"uuid,omitempty"`
	Name        string       `json:"name,omitempty"`
	Permissions []Permission `json:"permissions,omitempty"`
}

type RoleV1

type RoleV1 struct {
	UUID string `json:"uuid"`
	Name string `json:"name"`
}

RoleV1 is a role that a User may have in Pactflow

{
	"updatedAt": "2020-06-28T23:31:51+00:00",
	"createdAt": "2020-06-28T23:31:51+00:00",
	"uuid": "cf75d7c2-416b-11ea-af5e-53c3b1a4efd8",
	"name": "Administrator"
}

type Secret

type Secret struct {
	UUID        string `json:"-"`
	TeamUUID    string `json:"teamUuid,omitempty"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Value       string `json:"value"`
}

type SecretResponse

type SecretResponse struct {
	Secret
	HalDoc
}

curl 'https://dius.pact.dius.com.au/secrets' '{"name":"foo","description":"bar","value":"baz"}' --compressed

type SetUserRolesRequest

type SetUserRolesRequest struct {
	Roles []string `json:"roles"`
}

SetUserRolesRequest is used to set roles to a given user

type Team

type Team struct {
	UUID            string            `json:"uuid,omitempty"`
	Name            string            `json:"name,omitempty"`
	NumberOfMembers int               `json:"numberOfMembers,omitempty"`
	Embedded        TeamEmbeddedItems `json:"_embedded,omitempty"`
}

Team represents a user login to Pactflow

type TeamCreateOrUpdateRequest added in v0.7.0

type TeamCreateOrUpdateRequest struct {
	UUID               string   `json:"-"`
	Name               string   `json:"name"`
	PacticipantNames   []string `json:"pacticipantNames,omitempty"`
	AdministratorUUIDs []string `json:"administratorUuids,omitempty"`
	EnvironmentUUIDs   []string `json:"environmentUuids,omitempty"`
}

type TeamEmbeddedItems

type TeamEmbeddedItems struct {
	Pacticipants   []Pacticipant `json:"pacticipants,omitempty"`
	Members        []User        `json:"members,omitempty"`
	Administrators []User        `json:"administrators,omitempty"`
	Environments   []Environment `json:"environments,omitempty"`
}

type TeamsAssignmentRequest

type TeamsAssignmentRequest struct {
	// Team UUID
	UUID string `json:"-"`

	// List of user UUIDs
	Users []string `json:"users"`
}

type TeamsAssignmentResponse

type TeamsAssignmentResponse struct {
	Embedded EmbeddedUsers `json:"_embedded,omitempty"`
}

type TeamsResponse

type TeamsResponse struct {
	Team
	HalDoc
}

type UpdateResourceAssignmentPatchRequest

type UpdateResourceAssignmentPatchRequest struct {
	Operation string        `json:"op"`
	Path      string        `json:"path"`
	Value     PatchResource `json:"value"`
}

type User

type User struct {
	UUID               string   `json:"uuid,omitempty"`
	Name               string   `json:"name,omitempty"`
	Email              string   `json:"email,omitempty"`
	Active             bool     `json:"active"`
	CreatedAt          string   `json:"createdAt,omitempty"`
	UpdatedAt          string   `json:"updatedAt,omitempty"`
	LastLogin          string   `json:"lastLogin,omitempty"`
	IdentityProviderID string   `json:"identityProviderId,omitempty"`
	Type               UserType `json:"type,omitempty"`
	TypeDescription    string   `json:"typeDescription,omitempty"`
	Embedded           struct {
		Roles []Role `json:"roles,omitempty"`
		Teams []Team `json:"teams,omitempty"`
	} `json:"_embedded,omitempty"`
}

User represents a user login to Pactflow

type UserType

type UserType int

UserType describes the type of user represented in Pactflow

const (
	// RegularUser represents a human
	RegularUser UserType = iota

	// SystemAccount are designed for API access only and not for humans
	SystemAccount
)

type Users

type Users struct {
	Users []User `json:"users"`
}

Users is a list of User objects to manage

type Webhook

type Webhook struct {
	ID          string         `json:"-"`
	TeamUUID    string         `json:"teamUuid,omitempty"`
	Description string         `json:"description,omitempty"`
	Enabled     bool           `json:"enabled,omitempty"`
	CreatedAt   string         `json:"createdAt,omitempty"`
	Provider    *Pacticipant   `json:"provider,omitempty"`
	Consumer    *Pacticipant   `json:"consumer,omitempty"`
	Events      []WebhookEvent `json:"events,omitempty"`
	Request     Request        `json:"request,omitempty"`
}

Webhook represents a webhook configured in the broker

type WebhookEvent

type WebhookEvent struct {
	Name string `json:"name"`
}

WebhookEvent represents the types of events that trigger a Webhook

type WebhookResponse

type WebhookResponse struct {
	Webhook
	HalDoc
}

WebhookResponse is the response body for any CRU methods

Jump to

Keyboard shortcuts

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