controllers

package
v0.0.0-...-0888c38 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const NanosPerSecond int64 = 1000 * 1000 * 1000

NanosPerSecond is the number of nanoseconds per second.

Variables

View Source
var (
	// ErrGetAuthTokenFailed occurs when we are unable to get a token from the cookie or bearer.
	ErrGetAuthTokenFailed = errors.New("failed to get auth token: either a bearer auth or valid cookie session must exist")
	// ErrFetchAugmentedTokenFailedInternal occurs when making a request for the augmented auth results in an internal error.
	ErrFetchAugmentedTokenFailedInternal = errors.New("failed to fetch token - internal")
	// ErrFetchAugmentedTokenFailedUnauthenticated occurs when making a request for the augmented token results in an authentication error.
	ErrFetchAugmentedTokenFailedUnauthenticated = errors.New("failed to fetch token - unauthenticated")
	// ErrParseAuthToken occurs when we are unable to parse the augmented token with the signing key.
	ErrParseAuthToken = errors.New("Failed to parse token")
	// ErrCSRFOriginCheckFailed occurs when a request with seesion cookie is missing the origin field, or is invalid.
	ErrCSRFOriginCheckFailed = errors.New("CSRF check missing origin")
)

Functions

func AuthConnectorHandler

func AuthConnectorHandler(env commonenv.Env, w http.ResponseWriter, r *http.Request) error

AuthConnectorHandler receives an auth connector request and redirects to the auth connector callback with the access token.

func AuthLoginHandler

func AuthLoginHandler(env commonenv.Env, w http.ResponseWriter, r *http.Request) error

AuthLoginHandler make requests to the authpb service and sets session cookies. Request-type: application/json. Params: accessToken (auth0 accessToken), state.

func AuthLoginHandlerEmbed

func AuthLoginHandlerEmbed(env commonenv.Env, w http.ResponseWriter, r *http.Request) error

AuthLoginHandlerEmbed is the replacement embed login handler. Request-type: application/json. Params: accessToken (auth0 accessToken), state.

func AuthLogoutHandler

func AuthLogoutHandler(env commonenv.Env, w http.ResponseWriter, r *http.Request) error

AuthLogoutHandler deletes existing sessions. Request-type: application/json. Params: accessToken (auth0 idtoken), state.

func AuthOAuthLoginHandler

func AuthOAuthLoginHandler(env commonenv.Env, w http.ResponseWriter, r *http.Request) error

AuthOAuthLoginHandler handles logins for OSS oauth support.

func AuthRefetchHandler

func AuthRefetchHandler(env commonenv.Env, w http.ResponseWriter, r *http.Request) error

AuthRefetchHandler return a new user token with updated claims. Request-type: application/json.

func AuthSignupHandler

func AuthSignupHandler(env commonenv.Env, w http.ResponseWriter, r *http.Request) error

AuthSignupHandler make requests to the authpb service and sets session cookies. Request-type: application/json. Params: accessToken (auth0 idtoken), state.

func GetAugmentedTokenGRPC

func GetAugmentedTokenGRPC(ctx context.Context, env apienv.APIEnv) (string, error)

GetAugmentedTokenGRPC gets the augmented token for a grpc context.

func GetDefaultSession

func GetDefaultSession(env apienv.APIEnv, r *http.Request) (*sessions.Session, error)

GetDefaultSession loads the default session from the request. It will always return a valid session. If it returns an error, there was a problem decoding the previous session, or the previous session has expired.

func GetServiceCredentials

func GetServiceCredentials(signingKey string) (string, error)

GetServiceCredentials returns JWT credentials for inter-service requests.

func GetTokenFromSession

func GetTokenFromSession(env apienv.APIEnv, r *http.Request) (string, bool)

GetTokenFromSession gets a token from the session store using cookies.

func NewAPIKeyClient

func NewAPIKeyClient() (authpb.APIKeyServiceClient, error)

NewAPIKeyClient creates a new API key client.

func NewAuthClient

func NewAuthClient() (authpb.AuthServiceClient, error)

NewAuthClient creates a new auth RPC client stub.

func NewGraphQLHandler

func NewGraphQLHandler(graphqlEnv GraphQLEnv) http.Handler

NewGraphQLHandler is the HTTP handler used for handling GraphQL requests.

func NewUnauthenticatedGraphQLHandler

func NewUnauthenticatedGraphQLHandler(graphqlEnv GraphQLEnv) http.Handler

NewUnauthenticatedGraphQLHandler is the HTTP handler used for handling unauthenticated GraphQL requests.

func PrettifyClusterName

func PrettifyClusterName(name string, expanded bool) string

PrettifyClusterName uses heuristics to try to generate a better looking cluster name.

func WithAugmentedAuthMiddleware

func WithAugmentedAuthMiddleware(env apienv.APIEnv, next http.Handler) http.Handler

WithAugmentedAuthMiddleware augments auth by send minimal token to the auth server and using returned data to augment the session.

Types

type APIKeyMetadataResolver

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

APIKeyMetadataResolver is the resolver responsible for API key metadata.

func (*APIKeyMetadataResolver) CreatedAtMs

func (d *APIKeyMetadataResolver) CreatedAtMs() float64

CreatedAtMs returns the time at which the API key was created.

func (*APIKeyMetadataResolver) Desc

func (d *APIKeyMetadataResolver) Desc() string

Desc returns the description of the key.

func (*APIKeyMetadataResolver) ID

func (d *APIKeyMetadataResolver) ID() graphql.ID

ID returns API key ID.

type APIKeyResolver

type APIKeyResolver struct {
	APIKeyMetadataResolver
	// contains filtered or unexported fields
}

APIKeyResolver is the resolver responsible for API keys.

func (*APIKeyResolver) Key

func (d *APIKeyResolver) Key() string

Key returns the API key value.

type APIKeyServer

type APIKeyServer struct {
	APIKeyClient authpb.APIKeyServiceClient
}

APIKeyServer is the server that implements the APIKeyManager gRPC service.

func (*APIKeyServer) Create

Create creates a new API key.

func (*APIKeyServer) Delete

func (v *APIKeyServer) Delete(ctx context.Context, uuid *uuidpb.UUID) (*types.Empty, error)

Delete deletes a specific API key.

func (*APIKeyServer) Get

Get fetches a specific API key.

func (*APIKeyServer) List

List lists all of the API keys in vzmgr.

func (*APIKeyServer) LookupAPIKey

LookupAPIKey gets the complete API key information using just the Key.

type ArtifactTrackerServer

type ArtifactTrackerServer struct {
	ArtifactTrackerClient artifacttrackerpb.ArtifactTrackerClient
}

ArtifactTrackerServer is the GRPC server responsible for providing access to artifacts.

func (ArtifactTrackerServer) GetArtifactList

GetArtifactList gets the set of artifact versions for the given artifact.

GetDownloadLink gets the download link for the given artifact.

type AuthServer

type AuthServer struct {
	AuthClient authpb.AuthServiceClient
}

AuthServer logs users

func (*AuthServer) Login

Login logs the user in by taking an access token from the auth provider, or using an API key.

type AutocompleteFieldResolver

type AutocompleteFieldResolver struct {
	Suggestions          []*AutocompleteSuggestion
	HasAdditionalMatches bool
}

AutocompleteFieldResolver is the resolver for an autocomplete field response.

type AutocompleteResolver

type AutocompleteResolver struct {
	FormattedInput *string
	IsExecutable   *bool
	TabSuggestions *[]*TabSuggestion
}

AutocompleteResolver is the resolver for an autocomplete response.

type AutocompleteServer

type AutocompleteServer struct {
	Suggester autocomplete.Suggester
}

AutocompleteServer is the server that implements the Autocomplete gRPC service.

func (*AutocompleteServer) Autocomplete

Autocomplete returns a formatted string and autocomplete suggestions.

func (*AutocompleteServer) AutocompleteField

AutocompleteField returns suggestions for a single field.

type AutocompleteSuggestion

type AutocompleteSuggestion struct {
	Kind           *string
	Name           *string
	Description    *string
	MatchedIndexes *[]*int32
	State          *string
}

AutocompleteSuggestion represents a single suggestion.

type ClusterInfoResolver

type ClusterInfoResolver struct {
	Status                        string
	LastHeartbeatMs               float64
	VizierVersion                 string
	OperatorVersion               string
	ClusterVersion                string
	ClusterUID                    string
	ClusterName                   string
	PrettyClusterName             string
	StatusMessage                 string
	ControlPlanePodStatuses       []PodStatusResolver
	UnhealthyDataPlanePodStatuses []PodStatusResolver
	NumNodes                      int32
	NumInstrumentedNodes          int32
	PreviousStatus                *string
	PreviousStatusTimeMs          *float64
	// contains filtered or unexported fields
}

ClusterInfoResolver is the resolver responsible for cluster info.

func (*ClusterInfoResolver) ID

func (c *ClusterInfoResolver) ID() graphql.ID

ID returns cluster ID.

type ConfigServiceServer

type ConfigServiceServer struct {
	ConfigServiceClient configmanagerpb.ConfigManagerServiceClient
}

ConfigServiceServer sets vizier related configurations.

func (*ConfigServiceServer) GetConfigForOperator

GetConfigForOperator provides the key for the operator that is used to send errors and stacktraces to Sentry

func (*ConfigServiceServer) GetConfigForVizier

GetConfigForVizier fetches vizier templates and sets up yaml maps by calling Config Manager service.

type ContainerStatusResolver

type ContainerStatusResolver struct {
	Name         string
	CreatedAtMs  float64
	State        string
	Message      string
	Reason       string
	RestartCount int32
}

ContainerStatusResolver is the resolver responsible for container status info.

type DeploymentKeyMetadataResolver

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

DeploymentKeyMetadataResolver is the resolver responsible for deploy key metadata.

func (*DeploymentKeyMetadataResolver) CreatedAtMs

func (d *DeploymentKeyMetadataResolver) CreatedAtMs() float64

CreatedAtMs returns the time at which the deployment key was created.

func (*DeploymentKeyMetadataResolver) Desc

Desc returns the description of the key.

func (*DeploymentKeyMetadataResolver) ID

func (d *DeploymentKeyMetadataResolver) ID() graphql.ID

ID returns deployment key ID.

type DeploymentKeyResolver

type DeploymentKeyResolver struct {
	DeploymentKeyMetadataResolver
	// contains filtered or unexported fields
}

DeploymentKeyResolver resolves metadata and the current key value for a single key.

func (*DeploymentKeyResolver) Key

func (d *DeploymentKeyResolver) Key() string

Key returns the deployment key value.

type GraphQLEnv

type GraphQLEnv struct {
	ArtifactTrackerServer cloudpb.ArtifactTrackerServer
	VizierClusterInfo     cloudpb.VizierClusterInfoServer
	VizierDeployKeyMgr    cloudpb.VizierDeploymentKeyManagerServer
	APIKeyMgr             cloudpb.APIKeyManagerServer
	ScriptMgrServer       cloudpb.ScriptMgrServer
	AutocompleteServer    cloudpb.AutocompleteServiceServer
	OrgServer             cloudpb.OrganizationServiceServer
	UserServer            cloudpb.UserServiceServer
	PluginServer          cloudpb.PluginServiceServer
}

GraphQLEnv holds the GRPC API servers so the GraphQL server can call out to them.

type IDEPathResolver

type IDEPathResolver struct {
	IDEName string
	Path    string
}

IDEPathResolver is a resolver for an IDE path.

type K8sEventResolver

type K8sEventResolver struct {
	Message     string
	FirstTimeMs float64
	LastTimeMs  float64
}

K8sEventResolver is a resolver for k8s events.

type LiveViewContentsResolver

type LiveViewContentsResolver struct {
	Metadata    LiveViewMetadataResolver
	PxlContents string
	VisJSON     string
}

LiveViewContentsResolver resolves the content of a given live view.

type LiveViewMetadataResolver

type LiveViewMetadataResolver struct {
	ID   graphql.ID
	Name string
	Desc string
}

LiveViewMetadataResolver resolves metadata about a live view.

type OrgInfoResolver

type OrgInfoResolver struct {
	OrgInfo *cloudpb.OrgInfo
	// contains filtered or unexported fields
}

OrgInfoResolver resolves org information.

func (*OrgInfoResolver) DomainName

func (u *OrgInfoResolver) DomainName() string

DomainName returns the domain name (if this org is a GSuite based org) for the given org.

func (*OrgInfoResolver) EnableApprovals

func (u *OrgInfoResolver) EnableApprovals() bool

EnableApprovals returns whether the org requires admin approval for new users or not.

func (*OrgInfoResolver) ID

func (u *OrgInfoResolver) ID() graphql.ID

ID returns the org id.

func (*OrgInfoResolver) IDEPaths

func (u *OrgInfoResolver) IDEPaths() []IDEPathResolver

IDEPaths returns the configured IDE paths for the org, which can be used to navigate to a symbol in an IDE.

func (*OrgInfoResolver) Name

func (u *OrgInfoResolver) Name() string

Name returns the org name.

type OrganizationServiceServer

type OrganizationServiceServer struct {
	ProfileServiceClient profilepb.ProfileServiceClient
	AuthServiceClient    authpb.AuthServiceClient
	OrgServiceClient     profilepb.OrgServiceClient
}

OrganizationServiceServer is the server that implements the OrganizationService gRPC service.

func (*OrganizationServiceServer) AddOrgIDEConfig

AddOrgIDEConfig adds the IDE config for the given org.

func (*OrganizationServiceServer) CreateInviteToken

CreateInviteToken creates a signed invite JWT for the given org with an expiration of 1 week.

func (*OrganizationServiceServer) CreateOrg

CreateOrg will create a new org.

func (*OrganizationServiceServer) DeleteOrgIDEConfig

DeleteOrgIDEConfig deletes the IDE config from the given org.

func (*OrganizationServiceServer) GetOrg

GetOrg will retrieve org based on uuid.

func (*OrganizationServiceServer) GetOrgIDEConfigs

GetOrgIDEConfigs gets all IDE configs from the given org.

func (*OrganizationServiceServer) GetUsersInOrg

GetUsersInOrg will get users given an org id.

func (*OrganizationServiceServer) InviteUser

InviteUser creates and returns an invite link for the org for the specified user info.

func (*OrganizationServiceServer) RemoveUserFromOrg

RemoveUserFromOrg will remove the given user from this org.

func (*OrganizationServiceServer) RevokeAllInviteTokens

func (o *OrganizationServiceServer) RevokeAllInviteTokens(ctx context.Context, req *uuidpb.UUID) (*types.Empty, error)

RevokeAllInviteTokens revokes all pending invited for the given org by rotating the JWT signing key.

func (*OrganizationServiceServer) UpdateOrg

UpdateOrg will update org approval details.

func (*OrganizationServiceServer) VerifyInviteToken

VerifyInviteToken verifies that the given invite JWT is still valid by performing expiration and signing key checks.

type PluginConfigResolver

type PluginConfigResolver struct {
	Name        string
	Value       string
	Description string
}

PluginConfigResolver is the resolver responsible for resolving plugin configs.

type PluginInfoResolver

type PluginInfoResolver struct {
	Configs              []PluginConfigResolver
	AllowCustomExportURL bool
	AllowInsecureTLS     bool
	DefaultExportURL     string
}

PluginInfoResolver is the resolver responsible for resolving plugin info.

type PluginResolver

type PluginResolver struct {
	ID                string
	Name              string
	Description       string
	LatestVersion     string
	SupportsRetention bool
	RetentionEnabled  bool
	EnabledVersion    *string
}

PluginResolver is the resolver responsible for resolving plugins.

type PluginServiceServer

type PluginServiceServer struct {
	PluginServiceClient              pluginpb.PluginServiceClient
	DataRetentionPluginServiceClient pluginpb.DataRetentionPluginServiceClient
}

PluginServiceServer is used to manage and configure plugins.

func (*PluginServiceServer) CreateRetentionScript

CreateRetentionScript creates a retention script.

func (*PluginServiceServer) DeleteRetentionScript

DeleteRetentionScript deletes a specific retention script.

func (*PluginServiceServer) GetOrgRetentionPluginConfig

GetRetentionPluginConfig gets the retention plugin config for a plugin.

func (*PluginServiceServer) GetPlugins

GetPlugins fetches all of the available plugins and whether the org has the plugin enabled.

func (*PluginServiceServer) GetRetentionPluginInfo

GetRetentionPluginInfo gets the retention plugin info for a particular plugin release.

func (*PluginServiceServer) GetRetentionScript

GetRetentionScript gets detailed information about a specific retention script.

func (*PluginServiceServer) GetRetentionScripts

GetRetentionScripts gets the retention scripts configured for the org.

func (*PluginServiceServer) UpdateRetentionPluginConfig

UpdateRetentionPluginConfig updates the retention plugin config for a plugin.

func (*PluginServiceServer) UpdateRetentionScript

UpdateRetentionScript updates a specific retention script.

type PodStatusResolver

type PodStatusResolver struct {
	Name         string
	CreatedAtMs  float64
	Status       string
	Message      string
	Reason       string
	Containers   []ContainerStatusResolver
	Events       []K8sEventResolver
	RestartCount int32
}

PodStatusResolver is the resolver responsible for pod status info.

type QueryResolver

type QueryResolver struct {
	Env GraphQLEnv
}

QueryResolver resolves queries for GQL.

func (*QueryResolver) APIKey

func (q *QueryResolver) APIKey(ctx context.Context, args *getOrDeleteAPIKeyArgs) (*APIKeyResolver, error)

APIKey gets a specific API key.

func (*QueryResolver) APIKeys

APIKeys lists all of the API keys.

func (*QueryResolver) Autocomplete

func (q *QueryResolver) Autocomplete(ctx context.Context, args *autocompleteArgs) (*AutocompleteResolver, error)

Autocomplete responds to an autocomplete request.

func (*QueryResolver) AutocompleteField

func (q *QueryResolver) AutocompleteField(ctx context.Context, args *autocompleteFieldArgs) (*AutocompleteFieldResolver, error)

AutocompleteField is the resolver for autocompleting a single field.

func (*QueryResolver) Cluster

func (q *QueryResolver) Cluster(ctx context.Context, args *clusterArgs) (*ClusterInfoResolver, error)

Cluster resolves cluster information.

func (*QueryResolver) ClusterByName

func (q *QueryResolver) ClusterByName(ctx context.Context, args *clusterNameArgs) (*ClusterInfoResolver, error)

ClusterByName resolves cluster information given a cluster name.

func (*QueryResolver) Clusters

func (q *QueryResolver) Clusters(ctx context.Context) ([]*ClusterInfoResolver, error)

Clusters lists all of the clusters.

func (*QueryResolver) CreateAPIKey

func (q *QueryResolver) CreateAPIKey(ctx context.Context) (*APIKeyResolver, error)

CreateAPIKey creates a new API key.

func (*QueryResolver) CreateCluster

func (q *QueryResolver) CreateCluster(ctx context.Context) (*ClusterInfoResolver, error)

CreateCluster creates a new cluster.

func (*QueryResolver) CreateDeploymentKey

func (q *QueryResolver) CreateDeploymentKey(ctx context.Context) (*DeploymentKeyResolver, error)

CreateDeploymentKey creates a new deployment key.

func (*QueryResolver) CreateInviteToken

func (q *QueryResolver) CreateInviteToken(ctx context.Context, args *createInviteTokenArgs) (string, error)

CreateInviteToken creates a signed invite JWT for the given org with an expiration of 1 week.

func (*QueryResolver) CreateOrg

func (q *QueryResolver) CreateOrg(ctx context.Context, args *createOrgArgs) (graphql.ID, error)

CreateOrg creates an org with the given name and associates the current user with the newly created org.

func (*QueryResolver) CreateRetentionScript

func (q *QueryResolver) CreateRetentionScript(ctx context.Context, args createRetentionScriptArgs) (graphql.ID, error)

CreateRetentionScript creates a new retention script.

func (*QueryResolver) DeleteAPIKey

func (q *QueryResolver) DeleteAPIKey(ctx context.Context, args *getOrDeleteAPIKeyArgs) (bool, error)

DeleteAPIKey deletes a specific API key.

func (*QueryResolver) DeleteDeploymentKey

func (q *QueryResolver) DeleteDeploymentKey(ctx context.Context, args *getOrDeleteDeployKeyArgs) (bool, error)

DeleteDeploymentKey deletes a specific deployment key.

func (*QueryResolver) DeleteRetentionScript

func (q *QueryResolver) DeleteRetentionScript(ctx context.Context, args deleteRetentionScriptArgs) (bool, error)

DeleteRetentionScript deletes a retention script.

func (*QueryResolver) DeleteUser

func (q *QueryResolver) DeleteUser(ctx context.Context) (bool, error)

DeleteUser deletes the user with the current credentials.

func (*QueryResolver) DeploymentKey

func (q *QueryResolver) DeploymentKey(ctx context.Context, args *getOrDeleteDeployKeyArgs) (*DeploymentKeyResolver, error)

DeploymentKey gets a specific deployment key.

func (*QueryResolver) DeploymentKeys

func (q *QueryResolver) DeploymentKeys(ctx context.Context) ([]*DeploymentKeyMetadataResolver, error)

DeploymentKeys lists all of the deployment keys.

func (*QueryResolver) InviteUser

func (q *QueryResolver) InviteUser(ctx context.Context, args *inviteUserArgs) (*UserInviteResolver, error)

InviteUser invites the user with the given name and email address to the org by providing an invite link.

func (*QueryResolver) LiveViewContents

func (q *QueryResolver) LiveViewContents(ctx context.Context, args *liveViewContentsArgs) (*LiveViewContentsResolver, error)

LiveViewContents returns the contents for a given live view.

func (*QueryResolver) LiveViews

LiveViews lists available live views.

func (*QueryResolver) Noop

func (q *QueryResolver) Noop(ctx context.Context) (bool, error)

Noop is added to the query resolver to handle the fact that we can't define empty typesin graphql. :( There shouldn't be any consumers of Noop.

func (*QueryResolver) Org

Org resolves org information.

func (*QueryResolver) OrgRetentionPluginConfig

func (q *QueryResolver) OrgRetentionPluginConfig(ctx context.Context, args retentionPluginConfigArgs) ([]*PluginConfigResolver, error)

RetentionPluginConfig lists the configured values for the given retention plugin.

func (*QueryResolver) OrgUsers

func (q *QueryResolver) OrgUsers(ctx context.Context) ([]*UserInfoResolver, error)

OrgUsers gets the users in the org in the given context.

func (*QueryResolver) Plugins

func (q *QueryResolver) Plugins(ctx context.Context, args pluginsArgs) ([]*PluginResolver, error)

Plugins lists all of the plugins, filtered by kind if specified.

func (*QueryResolver) RemoveUserFromOrg

func (q *QueryResolver) RemoveUserFromOrg(ctx context.Context, args *removeUserFromOrg) (bool, error)

RemoveUserFromOrg removes the given user from the current org.

func (*QueryResolver) RetentionPluginConfig

func (q *QueryResolver) RetentionPluginConfig(ctx context.Context, args retentionPluginConfigArgs) (*RetentionPluginConfigResolver, error)

RetentionPluginConfig lists the configured values for the given retention plugin.

func (*QueryResolver) RetentionPluginInfo

func (q *QueryResolver) RetentionPluginInfo(ctx context.Context, args retentionPluginInfoArgs) (*PluginInfoResolver, error)

RetentionPluginInfo lists information about a specific plugin release.

func (*QueryResolver) RetentionScript

func (q *QueryResolver) RetentionScript(ctx context.Context, args retentionScriptArgs) (*RetentionScriptResolver, error)

RetentionScript fetches a single retention script, given an ID.

func (*QueryResolver) RetentionScripts

func (q *QueryResolver) RetentionScripts(ctx context.Context) ([]*RetentionScriptResolver, error)

RetentionScripts fetches all retention scripts belonging to the org.

func (*QueryResolver) RevokeAllInviteTokens

func (q *QueryResolver) RevokeAllInviteTokens(ctx context.Context, args *revokeAllInviteTokensArgs) (bool, error)

RevokeAllInviteTokens revokes all pending invited for the given org by rotating the JWT signing key.

func (*QueryResolver) ScriptContents

func (q *QueryResolver) ScriptContents(ctx context.Context, args *scriptContentsArgs) (*ScriptContentsResolver, error)

ScriptContents returns the contents for a given live view.

func (*QueryResolver) Scripts

Scripts lists available scripts.

func (*QueryResolver) SetUserAttributes

func (q *QueryResolver) SetUserAttributes(ctx context.Context, args *setUserAttributesArgs) (*UserAttributesResolver, error)

SetUserAttributes updates the user settings for the current user.

func (*QueryResolver) UpdateOrgSettings

func (q *QueryResolver) UpdateOrgSettings(ctx context.Context, args updateOrgSettingsArgs) (*OrgInfoResolver, error)

UpdateOrgSettings updates settings for the given org.

func (*QueryResolver) UpdateRetentionPluginConfig

func (q *QueryResolver) UpdateRetentionPluginConfig(ctx context.Context, args updateRetentionPluginConfigArgs) (bool, error)

UpdateRetentionPluginConfig updates the configs for a retention plugin, including enabling/disabling the plugin.

func (*QueryResolver) UpdateRetentionScript

func (q *QueryResolver) UpdateRetentionScript(ctx context.Context, args updateRetentionScriptArgs) (bool, error)

UpdateRetentionScript updates the details for a single retention script.

func (*QueryResolver) UpdateUserPermissions

func (q *QueryResolver) UpdateUserPermissions(ctx context.Context, args *updateUserPermissionsArgs) (*UserInfoResolver, error)

UpdateUserPermissions updates user permissions.

func (*QueryResolver) UpdateUserSettings

func (q *QueryResolver) UpdateUserSettings(ctx context.Context, args *updateUserSettingsArgs) (*UserSettingsResolver, error)

UpdateUserSettings updates the user settings for the current user.

func (*QueryResolver) User

User resolves user information.

func (*QueryResolver) UserAttributes

func (q *QueryResolver) UserAttributes(ctx context.Context) (*UserAttributesResolver, error)

UserAttributes resolves user attributes information.

func (*QueryResolver) UserSettings

func (q *QueryResolver) UserSettings(ctx context.Context) (*UserSettingsResolver, error)

UserSettings resolves user settings information.

func (*QueryResolver) VerifyInviteToken

func (q *QueryResolver) VerifyInviteToken(ctx context.Context, args *verifyInviteTokenArgs) (bool, error)

VerifyInviteToken verifies that the given invite JWT is still valid by performing expiration and signing key checks.

type RetentionPluginConfigResolver

type RetentionPluginConfigResolver struct {
	Configs         []*PluginConfigResolver
	CustomExportURL *string
	InsecureTLS     *bool
}

RetentionPluginConfigResolver is the resolver responsible for resolving the full config for a plugin.

type RetentionScriptResolver

type RetentionScriptResolver struct {
	Name        string
	Description string
	FrequencyS  int32
	Enabled     bool

	Contents        string
	PluginID        string
	CustomExportURL *string
	IsPreset        bool
	// contains filtered or unexported fields
}

RetentionScriptResolver is responsible for resolving retention plugin scripts.

func (*RetentionScriptResolver) Clusters

func (c *RetentionScriptResolver) Clusters() []graphql.ID

Clusters returns the IDs of the clusters with the script enabled.

func (*RetentionScriptResolver) ID

func (c *RetentionScriptResolver) ID() graphql.ID

ID returns cluster ID.

type ScriptContentsResolver

type ScriptContentsResolver struct {
	Metadata ScriptMetadataResolver
	Contents string
}

ScriptContentsResolver resolves the content of a given live view.

type ScriptMetadataResolver

type ScriptMetadataResolver struct {
	ID          graphql.ID
	Name        string
	Desc        string
	HasLiveView bool
}

ScriptMetadataResolver resolves metadata about a script.

type ScriptMgrServer

type ScriptMgrServer struct {
	ScriptMgr scriptmgrpb.ScriptMgrServiceClient
}

ScriptMgrServer is the server that implements the ScriptMgr gRPC service.

func (*ScriptMgrServer) GetLiveViewContents

GetLiveViewContents returns the pxl script, vis info, and metdata for a live view.

func (*ScriptMgrServer) GetLiveViews

GetLiveViews returns a list of all available live views.

func (*ScriptMgrServer) GetScriptContents

GetScriptContents returns the pxl string of the script.

func (*ScriptMgrServer) GetScripts

GetScripts returns a list of all available scripts.

type TabSuggestion

type TabSuggestion struct {
	TabIndex              *int32
	ExecutableAfterSelect *bool
	Suggestions           *[]*AutocompleteSuggestion
}

TabSuggestion represents suggestions for a tab index.

type UserAttributesResolver

type UserAttributesResolver struct {
	TourSeen bool
	ID       graphql.ID
}

UserAttributesResolver is a resolver for user attributes.

type UserInfoResolver

type UserInfoResolver struct {
	GQLEnv   *GraphQLEnv
	UserInfo *cloudpb.UserInfo
	// contains filtered or unexported fields
}

UserInfoResolver resolves user information.

func (*UserInfoResolver) Email

func (u *UserInfoResolver) Email() string

Email returns the user email.

func (*UserInfoResolver) ID

func (u *UserInfoResolver) ID() graphql.ID

ID returns the user id.

func (*UserInfoResolver) IsApproved

func (u *UserInfoResolver) IsApproved() bool

IsApproved returns whether the user has been approved by an admin user.

func (*UserInfoResolver) Name

func (u *UserInfoResolver) Name() string

Name returns the user name.

func (*UserInfoResolver) OrgID

func (u *UserInfoResolver) OrgID() string

OrgID returns the user's org id.

func (*UserInfoResolver) OrgName

func (u *UserInfoResolver) OrgName() string

OrgName returns the user's org name.

func (*UserInfoResolver) Picture

func (u *UserInfoResolver) Picture() string

Picture returns the users picture/avatar.

type UserInviteResolver

type UserInviteResolver struct {
	Email      string
	InviteLink string
}

UserInviteResolver resolves a user invite.

type UserServiceServer

type UserServiceServer struct {
	ProfileServiceClient profilepb.ProfileServiceClient
	OrgServiceClient     profilepb.OrgServiceClient
}

UserServiceServer is the server that implements the UserService gRPC service.

func (*UserServiceServer) DeleteUser

DeleteUser will delete the user. The request must be made by the user being deleted.

func (*UserServiceServer) GetUser

func (u *UserServiceServer) GetUser(ctx context.Context, req *uuidpb.UUID) (*cloudpb.UserInfo, error)

GetUser will retrieve user based on UUID.

func (*UserServiceServer) GetUserAttributes

GetUserAttributes will retrieve attributes given the user ID.

func (*UserServiceServer) GetUserSettings

GetUserSettings will retrieve settings given the user ID.

func (*UserServiceServer) SetUserAttributes

SetUserAttributes will update the attributes for the given user.

func (*UserServiceServer) UpdateUser

UpdateUser will update user information.

func (*UserServiceServer) UpdateUserSettings

UpdateUserSettings will update the settings for the given user.

type UserSettingsResolver

type UserSettingsResolver struct {
	AnalyticsOptout bool
	ID              graphql.ID
}

UserSettingsResolver resolves user settings.

type VizierClusterInfo

type VizierClusterInfo struct {
	VzMgr                 vzmgrpb.VZMgrServiceClient
	ArtifactTrackerClient artifacttrackerpb.ArtifactTrackerClient
}

VizierClusterInfo is the server that implements the VizierClusterInfo gRPC service.

func (*VizierClusterInfo) CreateCluster

CreateCluster creates a cluster for the current org.

func (*VizierClusterInfo) GetClusterConnectionInfo

GetClusterConnectionInfo returns information about connections to Vizier cluster.

func (*VizierClusterInfo) GetClusterInfo

GetClusterInfo returns information about Vizier clusters.

func (*VizierClusterInfo) UpdateClusterVizierConfig

UpdateClusterVizierConfig supports updates of VizierConfig for a cluster

func (*VizierClusterInfo) UpdateOrInstallCluster

UpdateOrInstallCluster updates or installs the given vizier cluster to the specified version.

type VizierDeploymentKeyServer

type VizierDeploymentKeyServer struct {
	VzDeploymentKey vzmgrpb.VZDeploymentKeyServiceClient
}

VizierDeploymentKeyServer is the server that implements the VizierDeploymentKeyManager gRPC service.

func (*VizierDeploymentKeyServer) Create

Create creates a new deploy key in vzmgr.

func (*VizierDeploymentKeyServer) Delete

Delete deletes a specific deploy key in vzmgr.

func (*VizierDeploymentKeyServer) Get

Get fetches a specific deploy key in vzmgr.

func (*VizierDeploymentKeyServer) List

List lists all of the deploy keys in vzmgr.

func (*VizierDeploymentKeyServer) LookupDeploymentKey

LookupDeploymentKey gets the complete API key information using just the Key.

type VizierImageAuthServer

type VizierImageAuthServer struct{}

VizierImageAuthServer is the GRPC server responsible for providing access to Vizier images.

func (VizierImageAuthServer) GetImageCredentials

GetImageCredentials fetches image credentials for vizier.

Directories

Path Synopsis
schema
complete
Code generated for package complete by go-bindata DO NOT EDIT.
Code generated for package complete by go-bindata DO NOT EDIT.
noauth
Code generated for package noauth by go-bindata DO NOT EDIT.
Code generated for package noauth by go-bindata DO NOT EDIT.

Jump to

Keyboard shortcuts

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