params

package
v3.3.12 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuditActionCreate is the Action value in an audit entry that
	// creates an entity.
	AuditActionCreate = "create"

	// AuditActionDelete is the Action value in an audit entry that
	// deletes an entity.
	AuditActionDelete = "delete"

	// AuditActionGrant is the Action value in an audit entry that
	// grants access to an entity.
	AuditActionGrant = "grant"

	// AuditActionRevoke is the Action value in an audit entry that
	// revokes access from an entity.
	AuditActionRevoke = "revoke"
)
View Source
const (
	CodeStillAlive = "still alive"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCloudToControllerRequest

type AddCloudToControllerRequest struct {
	jujuparams.AddCloudArgs

	// ControllerName is the name of the controller to which the
	// cloud should be added.
	ControllerName string `json:"controller-name"`
}

An AddCloudToControllerRequest is the request sent when adding a new cloud to a specific controller.

type AddControllerRequest

type AddControllerRequest struct {
	// UUID of the controller.
	UUID string `json:"uuid"`

	// Name is the name to give to the controller, all controllers must
	// have a unique name.
	Name string `json:"name"`

	// PublicAddress is the public address of the controller. This is
	// normally a DNS name and port which provide the controller endpoints.
	// This address should not change even if the controller units
	// themselves are migrated.
	PublicAddress string `json:"public-address,omitempty"`

	// TLSHostname is the hostname used for TLS verification.
	TLSHostname string `json:"tls-hostname,omitempty"`

	// APIAddresses contains the currently known API addresses for the
	// controller.
	APIAddresses []string `json:"api-addresses,omitempty"`

	// CACertificate contains the CA certificate to use to validate the
	// connection to the controller. This is not needed if certificate is
	// signed by a public CA.
	CACertificate string `json:"ca-certificate,omitempty"`

	// Username contains the username that JIMM should use to connect to
	// the controller.
	Username string `json:"username"`

	// Password contains the password that JIMM should use to connect to
	// the controller.
	Password string `json:"password"`
}

An AddControllerRequest is the request sent when adding a new controller to JIMM.

type AddGroupRequest

type AddGroupRequest struct {
	// Name holds the name of the group.
	Name string `json:"name"`
}

AddGroupRequest holds a request to add a group.

type AddGroupResponse

type AddGroupResponse struct {
	Group
}

AddGroupResponse holds the details of the added group.

type AddModelToControllerRequest added in v3.3.12

type AddModelToControllerRequest struct {
	jujuparams.ModelCreateArgs

	// ControllerName is the name of the controller to which the
	// model should be added.
	ControllerName string `json:"controller-name"`
}

An AddModelToControllerRequest is the request sent when adding a new model to a specific controller.

type AddRelationRequest

type AddRelationRequest struct {
	Tuples []RelationshipTuple `yaml:"tuples" json:"tuples"`
}

AddRelationRequest holds the tuples to be added to OpenFGA in an AddRelation request.

type AddRoleRequest added in v3.0.6

type AddRoleRequest struct {
	// Name holds the name of the role.
	Name string `json:"name"`
}

AddRoleRequest holds a request to add a role.

type AddRoleResponse added in v3.0.6

type AddRoleResponse struct {
	Role
}

AddRoleResponse holds the details of the added role.

type AuditEvent

type AuditEvent struct {
	// Time is the time of the audit event.
	Time time.Time `json:"time" yaml:"time"`

	// ConversationId contains a unique ID per websocket request.
	ConversationId string `json:"conversation-id" yaml:"conversation-id"`

	// MessageId represents the message ID used to correlate request/responses.
	MessageId uint64 `json:"message-id" yaml:"message-id"`

	// FacadeName contains the request facade name.
	FacadeName string `json:"facade-name,omitempty" yaml:"facade-name,omitempty"`

	// FacadeMethod contains the specific method to be executed on the facade.
	FacadeMethod string `json:"facade-method,omitempty" yaml:"facade-method,omitempty"`

	// FacadeVersion contains the requested version for the facade method.
	FacadeVersion int `json:"facade-version,omitempty" yaml:"facade-version,omitempty"`

	// ObjectId contains the object id to act on, only used by certain facades.
	ObjectId string `json:"object-id,omitempty" yaml:"object-id,omitempty"`

	// UserTag contains the user tag of authenticated user that performed
	// the action.
	UserTag string `json:"user-tag,omitempty" yaml:"user-tag,omitempty"`

	// Model contains the name of the model the event was performed against.
	Model string `json:"model,omitempty" yaml:"model,omitempty"`

	// IsResponse indicates whether the message is a request/response.
	IsResponse bool `json:"is-response" yaml:"is-response"`

	// Params contains client request parameters.
	Params map[string]any `json:"params,omitempty" yaml:"params,omitempty"`

	// Errors contains error info received from the controller.
	Errors map[string]any `json:"errors,omitempty" yaml:"errors,omitempty"`
}

An AuditEvent is an event in the audit log.

type AuditEvents

type AuditEvents struct {
	Events []AuditEvent `json:"events"`
}

An AuditEvents contains events from the audit log.

type AuditLogAccessRequest

type AuditLogAccessRequest struct {
	// UserTag is the user who's audit-log access is being modified.
	UserTag string `json:"user-tag"`

	// Level is the access level being granted or revoked. The only access
	// level is "read".
	Level string `json:"level"`
}

AuditLogAccessRequest is the request used to modify a user's access to the audit log.

type BootstrapParams added in v3.3.12

type BootstrapParams struct {
	// CloudName specifies the target cloud for the controller.
	CloudName string `json:"cloud-name"`
	// RegionName specifies the target region for the controller.
	RegionName string `json:"region-name"`
	// Cloud holds the cloud definition that will be used to bootstrap the controller.
	Cloud jujuparams.Cloud `json:"cloud,omitempty"`
	// Credential contains the cloud credential and its tag, this credential will be used against the
	// the cloud provided to bootstrap the controller.
	Credential jujuparams.CloudCredential `json:"credential"`

	// ControllerName specifies the name of the controller as recorded in JIMM.
	ControllerName string `json:"controller-name"`
	// Config holds configuration options for the bootstrap job.
	Config map[string]string `json:"config"`

	// ControllerVersion is the version of the controller to be bootstrapped.
	ControllerVersion string `json:"controller-version"`
}

BootstrapParams holds parameters for starting a controller bootstrap job.

type CheckRelationRequest

type CheckRelationRequest struct {
	Tuple RelationshipTuple `json:"tuple"`
}

CheckRelationRequest holds a tuple containing the object, target object and relation that we wish verify authorisation with.

type CheckRelationResponse

type CheckRelationResponse struct {
	Allowed bool   `json:"allowed" yaml:"allowed"`
	Error   string `json:"error,omitempty" yaml:"error,omitempty"`
}

CheckRelationResponse simple responds with an object containing a boolean of 'allowed' or not when a check for access is requested.

type CheckRelationsRequest added in v3.3.12

type CheckRelationsRequest struct {
	Tuples []RelationshipTuple `json:"tuples"`
}

CheckRelationsRequest holds the tuples containing the object, target object and relation that we wish verify authorisation with.

type CheckRelationsResponse added in v3.3.12

type CheckRelationsResponse struct {
	Results []CheckRelationResponse `json:"results" yaml:"results"`
}

CheckRelationResponse simple responds with an object containing a boolean of 'allowed' or not when a check for access is requested.

type ControllerInfo

type ControllerInfo struct {
	// Name is the name of the controller.
	Name string `json:"name"`

	// UUID is the UUID of the controller.
	UUID string `json:"uuid"`

	// PublicAddress is the public address of the controller. This is
	// normally a DNS name and port which provide the controller endpoints.
	// This address should not change even if the controller units
	// themselves are migrated.
	PublicAddress string `json:"public-address,omitempty"`

	// APIAddresses contains the currently known API addresses for the
	// controller.
	APIAddresses []string `json:"api-addresses,omitempty"`

	// CACertificate contains the CA certificate to use to validate the
	// connection to the controller. This is not needed if certificate is
	// signed by a public CA.
	CACertificate string `json:"ca-certificate,omitempty"`

	// CloudTag is the tag of the cloud this controller is running in.
	CloudTag string `json:"cloud-tag,omitempty"`

	// CloudRegion is the region that this controller is running in.
	CloudRegion string `json:"cloud-region,omitempty"`

	// The version of the juju agent running on the controller.
	AgentVersion string `json:"agent-version"`

	// Status contains the current status of the controller. The status
	// will either be "available", "deprecated", or "unavailable".
	Status jujuparams.EntityStatus `json:"status"`
}

A ControllerInfo describes a controller on a JIMM system.

type CrossModelQueryRequest

type CrossModelQueryRequest struct {
	Type  string `json:"type"`
	Query string `json:"query"`
}

CrossModelQueryRequest holds the parameters to perform a cross model query against JSON model statuses for every model this user has access to.

type CrossModelQueryResponse

type CrossModelQueryResponse struct {
	Results map[string][]any    `json:"results" yaml:"results"`
	Errors  map[string][]string `json:"errors" yaml:"errors"`
}

CrossModelJqQueryResponse holds results for a cross-model query that has been filtered utilising JQ. It has two fields:

  • Results - A map of each iterated JQ output result. The key for this map is the model UUID.
  • Errors - A map of each iterated JQ *or* Status call error. The key for this map is the model UUID.

type DestroyControllerRequest added in v3.3.12

type DestroyControllerRequest struct {
	// ControllerName of the controller to destroy
	ControllerName string `json:"controller-name"`
}

DestroyControllerRequest holds the name of the controller to be destroyed.

type FindAuditEventsRequest

type FindAuditEventsRequest struct {
	// After is used to filter the event log to only contain events that
	// happened after a certain time. If this is specified it must contain
	// an RFC3339 encoded time value.
	After string `json:"after,omitempty"`

	// Before is used to filter the event log to only contain events that
	// happened before a certain time. If this is specified it must contain
	// an RFC3339 encoded time value.
	Before string `json:"before,omitempty"`

	// UserTag is used to filter the event log to only contain events that
	// were performed by a particular authenticated user.
	UserTag string `json:"user-tag,omitempty"`

	// Model is used to filter the event log to only contain events that
	// were performed against a specific model.
	Model string `json:"model,omitempty"`

	// Method is used to filter the event log to only contain events that
	// called a specific facade method.
	Method string `json:"method,omitempty"`

	// Offset is the number of items to offset the set of returned results.
	Offset int `json:"offset,omitempty"`

	// Limit is the maximum number of audit events to return.
	Limit int `json:"limit,omitempty"`

	// SortTime will sort by most recent (time descending) when true.
	// When false no explicit ordering will be applied.
	SortTime bool `json:"sortTime,omitempty"`
}

A FindAuditEventsRequest finds audit events that match the specified query.

type FullModelStatusRequest

type FullModelStatusRequest struct {
	ModelTag string
	Patterns []string
}

FullModelStatusRequest is the request that is sent in a FullModelStatus method.

type GetDeviceSessionTokenResponse

type GetDeviceSessionTokenResponse struct {
	// SessionToken is a base64 encoded JWT capable of authenticating
	// a user. The JWT contains the users email address in the subject,
	// and this is used to identify this user.
	SessionToken string `json:"session-token" yaml:"session-token"`
}

GetDeviceSessionTokenResponse returns a session token to be used against LoginWithSessionToken for authentication. The session token will be base64 encoded.

type GetGroupRequest added in v3.0.4

type GetGroupRequest struct {
	// UUID holds the UUID of the group to be retrieved.
	UUID string `json:"uuid"`
	// Name holds the name of the group to be retrieved.
	Name string `json:"name"`
}

GetGroupRequest holds a request to get a group by UUID or name.

type GetGroupResponse added in v3.0.4

type GetGroupResponse struct {
	Group
}

GetGroupResponse holds the details of the group.

type GetJobInfoRequest added in v3.3.12

type GetJobInfoRequest struct {
	// JobID is the ID of the job to get the status for.
	JobID string `json:"job-id"`
	// Watermark is the line number to start reading logs from.
	Watermark int `json:"watermark"`
}

GetJobInfoRequest holds the request to get the status of a job.

type GetJobInfoResponse added in v3.3.12

type GetJobInfoResponse struct {
	// Status is the status of the job.
	Status JobStatus `json:"status"`
	// Logs are the logs for the job.
	Logs []string `json:"logs"`
	// Watermark is the line number to use for the next request.
	Watermark int `json:"watermark"`
	// Error is the error message if the job failed.
	Error string `json:"error,omitempty"`
}

GetJobInfoResponse holds the response for a job status.

type GetRoleRequest added in v3.0.6

type GetRoleRequest struct {
	// UUID holds the UUID of the role to be retrieved.
	UUID string `json:"uuid"`
	// Name holds the name of the role to be retrieved.
	Name string `json:"name"`
}

GetRoleRequest holds a request to get a role by UUID or name.

type GetRoleResponse added in v3.0.6

type GetRoleResponse struct {
	Role
}

GetRoleResponse holds the details of the role.

type Group

type Group struct {
	UUID      string `json:"uuid" yaml:"uuid"`
	Name      string `json:"name" yaml:"name"`
	CreatedAt string `json:"created_at" yaml:"created_at"`
	UpdatedAt string `json:"updated_at" yaml:"updated_at"`
}

Group holds the details of a group currently residing in JIMM.

type ImportModelRequest

type ImportModelRequest struct {
	// Controller holds that name of the controller that is running the
	// model.
	Controller string `json:"controller"`

	// ModelTag is the tag of the model that is to be imported.
	ModelTag string `json:"model-tag"`

	// Owner specifies the new owner of the model after import.
	// Can be empty to skip switching the owner.
	Owner string `json:"owner"`
}

An ImportModelRequest holds a request to import a model running on the specified controller such that the model is known to JIMM.

type JobStatus added in v3.3.12

type JobStatus string

JobStatus represents the status of a job.

const (
	StatusRunning    JobStatus = "running"
	StatusSuccessful JobStatus = "successful"
	StatusPending    JobStatus = "pending"
	StatusFailed     JobStatus = "failed"
)

type ListControllersResponse

type ListControllersResponse struct {
	Controllers []ControllerInfo `json:"controllers" yaml:"controllers"`
}

A ListControllersResponse is the response that is sent in a ListControllers method.

type ListGroupResponse

type ListGroupResponse struct {
	Groups []Group `json:"name" yaml:"name"`
}

ListGroupResponse returns the group tuples currently residing within OpenFGA.

type ListGroupsRequest

type ListGroupsRequest struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
}

type ListMigrationTargetsRequest added in v3.3.12

type ListMigrationTargetsRequest struct {
	// ModelTag holds the tag of the model.
	ModelTag string `json:"model-tag"`
}

ListMigrationTargetsRequest holds the model to query for controllers that are valid targets for an internal model migration.

type ListRelationshipTuplesRequest

type ListRelationshipTuplesRequest struct {
	Tuple             RelationshipTuple `json:"tuple,omitempty"`
	PageSize          int32             `json:"page_size,omitempty"`
	ContinuationToken string            `json:"continuation_token,omitempty"`
	ResolveUUIDs      bool              `json:"resolve_uuids,omitempty"`
}

ListRelationshipTuplesRequests holds the request information to list tuples.

type ListRelationshipTuplesResponse

type ListRelationshipTuplesResponse struct {
	Tuples            []RelationshipTuple `json:"tuples,omitempty" yaml:"tuples,omitempty"`
	Errors            []string            `json:"errors,omitempty" yaml:"errors,omitempty"`
	ContinuationToken string              `json:"continuation_token,omitempty" yaml:"continuation_token,omitempty"`
}

ListRelationshipTuplesResponse holds the response of the ListRelationshipTuples method.

type ListRoleResponse added in v3.0.6

type ListRoleResponse struct {
	Roles []Role `json:"name" yaml:"name"`
}

ListRoleResponse contains a list of roles

type ListRolesRequest added in v3.0.6

type ListRolesRequest struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
}

ListRolesRequest holds a request to list roles.

type LoginDeviceResponse

type LoginDeviceResponse struct {
	// VerificationURI holds the URI that the user must navigate to
	// when entering their "user-code" to consent to this authorisation
	// request.
	VerificationURI string `json:"verification-uri" yaml:"verification-uri"`
	// UserCode holds the one-time use user consent code.
	UserCode string `json:"user-code" yaml:"user-code"`
}

LoginDeviceResponse holds the details to complete a LoginDevice flow.

type LoginWithClientCredentialsRequest

type LoginWithClientCredentialsRequest struct {
	ClientID     string `json:"client-id"`
	ClientSecret string `json:"client-secret"`
}

LoginWithClientCredentialsRequest holds the client id and secret used to authenticate with JIMM.

type LoginWithSessionTokenRequest

type LoginWithSessionTokenRequest struct {
	// SessionToken is a base64 encoded JWT capable of authenticating
	// a user. The JWT contains the users email address in the subject,
	// and this is used to identify this user.
	SessionToken string `json:"session-token"`
}

LoginWithSessionTokenRequest accepts a session token minted by JIMM and logs the user in.

The login response for this login request type is that of jujuparams.LoginResult, such that the behaviour of previous macroon based authentication is unchanged. However, on unauthenticated requests, the error is different and is not a macaroon discharge request.

type MigrateModelInfo

type MigrateModelInfo struct {
	// TargetModelNameOrUUID can be either the model name or model UUID.
	TargetModelNameOrUUID string `json:"model-tag"`
	// TargetController is the controller name of the form "<name>"
	TargetController string `json:"target-controller"`
}

MigrateModelInfo represents a single migration where a source model target controller must be specified with both the source model and target controller residing within JIMM.

type MigrateModelRequest

type MigrateModelRequest struct {
	Specs []MigrateModelInfo `json:"specs"`
}

MigrateModelRequest allows for multiple migration requests to be made.

type PrepareModelMigrationRequest added in v3.3.12

type PrepareModelMigrationRequest struct {
	ModelTag              string            `json:"model-tag" yaml:"model-tag"`
	BackingControllerName string            `json:"backing-controller-name" yaml:"backing-controller-name"`
	UserMapping           map[string]string `json:"user-mapping" yaml:"user-mapping"`
}

PrepareModelMigrationRequest holds the details to prepare JIMM for a model migration.

type PrepareModelMigrationResponse added in v3.3.12

type PrepareModelMigrationResponse struct {
	// Token is the token that should be used to initiate the migration
	// as it allows the source controller to authenticate with JIMM.
	Token string `json:"token" yaml:"token"`
}

PrepareModelMigrationResponse holds the response for a model migration.

type PurgeLogsRequest

type PurgeLogsRequest struct {
	// Date is the date before which logs should be purged.
	Date time.Time `json:"date"`
}

PurgeLogsRequest is the request used to purge logs.

type PurgeLogsResponse

type PurgeLogsResponse struct {
	DeletedCount int64 `json:"deleted-count" yaml:"deleted-count"`
}

PurgeLogsResponse is the response returned by the PurgeLogs method. It has one field: - DeletedCount - the number of logs that were deleted.

type RelationshipTuple

type RelationshipTuple struct {
	// Object represents an OFGA object that we wish to apply a relational tuple to.
	Object string `yaml:"object" json:"object"`
	// Relation is exactly that, the kind of relation this request modifies.
	Relation string `yaml:"relation" json:"relation"`
	// TargetObject is the kind of object we wish to create/remove a tuple for/with
	// the provided relation.
	TargetObject string `yaml:"target_object" json:"target_object"`
}

RelationshipTuple represents a OpenFGA Tuple.

type RemoveCloudFromControllerRequest

type RemoveCloudFromControllerRequest struct {
	// CloudTag is the tag of the cloud this controller is running in.
	CloudTag string `json:"cloud-tag"`
	// ControllerName is the name of the controller from which the
	// cloud should be removed.
	ControllerName string `json:"controller-name"`
}

A RemoveCloudFromControllerRequest is the request sent when removing cloud from a specific controller.

type RemoveControllerRequest

type RemoveControllerRequest struct {
	Name  string `json:"name"`
	Force bool   `json:"force"`
}

A RemoveControllerRequest is the request that is sent in a RemoveController method.

type RemoveGroupRequest

type RemoveGroupRequest struct {
	// Name holds the name of the group.
	Name string `json:"name"`
}

RemoveGroupRequest holds a request to remove a group.

type RemoveRelationRequest

type RemoveRelationRequest struct {
	Tuples []RelationshipTuple `json:"tuples"`
}

RemoveRelationRequest holds the request information to remove tuples.

type RemoveRoleRequest added in v3.0.6

type RemoveRoleRequest struct {
	// Name holds the name of the role.
	Name string `json:"name"`
}

RemoveRoleRequest holds a request to remove a role.

type RenameGroupRequest

type RenameGroupRequest struct {
	// Name holds the name of the group.
	Name string `json:"name"`

	// NewName holds the new name of the group.
	NewName string `json:"new-name"`
}

RenameGroupRequest holds a request to rename a group.

type RenameRoleRequest added in v3.0.6

type RenameRoleRequest struct {
	// Name holds the name of the role.
	Name string `json:"name"`
	// NewName holds the new name of the role.
	NewName string `json:"new-name"`
}

RenameRoleRequest holds a request to rename a role.

type Role added in v3.0.6

type Role struct {
	UUID      string `json:"uuid" yaml:"uuid"`
	Name      string `json:"name" yaml:"name"`
	CreatedAt string `json:"created_at" yaml:"created_at"`
	UpdatedAt string `json:"updated_at" yaml:"updated_at"`
}

Role holds the details of a role currently.

type SetControllerDeprecatedRequest

type SetControllerDeprecatedRequest struct {
	// Name is the name of the controller to set deprecated.
	Name string `json:"name"`

	// Deprecated specifies whether the controller should be set to
	// deprecated or not.
	Deprecated bool `json:"deprecated"`
}

A SetControllerDeprecatedRequest is the request this is sent in a SetControllerDeprecated method.

type StartJobResponse added in v3.3.12

type StartJobResponse struct {
	// JobID is the ID of the job that was started.
	JobID string `json:"job-id"`
}

StartJobResponse holds the response for starting a controller job.

type StopJobRequest added in v3.3.12

type StopJobRequest struct {
	// JobID is the ID of the job to stop.
	JobID string `json:"job-id"`
}

StopJobRequest holds the request to stop a job.

type UpdateMigratedModelRequest

type UpdateMigratedModelRequest struct {
	// ModelTag holds the tag of the model that has been migrated.
	ModelTag string `json:"model-tag"`
	// TargetController holds the name of the controller the
	// model has been migrated to.
	TargetController string `json:"target-controller"`
}

UpdateMigratedModelRequest holds a request to check if the specified model has been migrated to the specified controller and update the model accordingly.

type UpgradeToRequest added in v3.3.12

type UpgradeToRequest struct {
	// ModelTag is the tag of the model to upgrade.
	ModelTag string `json:"model-tag"`
	// TargetControllerVersion is the target controller version to upgrade to.
	TargetControllerVersion string `json:"target-controller-version"`
}

UpgradeToRequest holds the parameters for phase 1 for automated upgrades.

type UpgradeToResponse added in v3.3.12

type UpgradeToResponse struct {
	Success bool `json:"success"`
}

UpgradeToResponse holds the response for phase 1 of an automated upgrade.

type VersionResponse added in v3.0.4

type VersionResponse struct {
	Version string `json:"version" yaml:"version"`
	Commit  string `json:"commit" yaml:"commit"`
}

VersionResponse holds the response for a version call.

type WhoamiResponse

type WhoamiResponse struct {
	DisplayName string `json:"display-name" yaml:"display-name"`
	Email       string `json:"email" yaml:"email"`
}

WhoamiResponse holds the response for a /auth/whoami call.

Jump to

Keyboard shortcuts

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