graphql

package
v1.45.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserPrincipalNotFound = errors.New("could not find user principal in request context")
)

Functions

func NewClient

func NewClient(config Configuration, hc *http.Client) graphql.Client

NewClient returns a new GraphQL client. The provided HTTP client should supply its own bearer token. You can use this client to make requests on behalf of tenants in the following way: - The HTTP client's bearer token should have an "admin" scope (OR, in development or staging, you can set the Hasura admin secret). - This GraphQL client will assume the "armory:hasura:admin" role (only possible because of the "admin" scope). - When making requests with the GraphQL client, pass a context with an iam.ArmoryCloudPrincipal.

Types

type Configuration

type Configuration struct {
	BaseURL string

	// If provided, the client will add the Hasura server admin secret as a request header.
	// This is not advised for production, since it is not easy to rotate Hasura admin secrets.
	AdminSecret string
}

Jump to

Keyboard shortcuts

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