api

package
v0.0.0-...-8551d7a Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSRequest

type AWSRequest struct {
	AccessKeyID     string `json:"accessKeyId"`
	SecretAccessKey string `json:"secretAccessKey"`
	SessionToken    string `json:"sessionToken"`
	Region          string `json:"region"`
	ClusterID       string `json:"clusterID"`
}

AWSRequest is the structure of an request for one of the AWS methods.

type AWSSSOConfig

type AWSSSOConfig struct {
	AWSSSOCredentials
	Client ssooidc.RegisterClientOutput           `json:"client"`
	Device ssooidc.StartDeviceAuthorizationOutput `json:"device"`
}

AWSSSOConfig is the structure to return the configuration for AWS SSO.

type AWSSSOCredentials

type AWSSSOCredentials struct {
	AccessKeyID       string `json:"accessKeyId"`
	SecretAccessKey   string `json:"secretAccessKey"`
	SessionToken      string `json:"sessionToken"`
	Expire            int64  `json:"expire"`
	Region            string `json:"region"`
	SSORegion         string `json:"ssoRegion"`
	StartURL          string `json:"startURL"`
	AccountID         string `json:"accountID"`
	RoleName          string `json:"roleName"`
	AccessToken       string `json:"accessToken"`
	AccessTokenExpire int64  `json:"accessTokenExpire"`
	ClusterID         string `json:"clusterID"`
}

AWSSSOCredentials returns AWS credentials generated via AWS SSO.

type AWSTokenResponse

type AWSTokenResponse struct {
	Token string `json:"token"`
}

AWSTokenResponse is the structure to return an Token for AWS.

type ApiTokenRequest

type ApiTokenRequest struct {
	Current     bool   `json:"current"`
	Enabled     bool   `json:"enabled"`
	Expired     bool   `json:"expired"`
	IsDerived   bool   `json:"isDerived"`
	TTL         int    `json:"ttl"`
	Type        string `json:"type"`
	Description string `json:"description"`
	Id          string `json:"id"`
}

Model for creating rancher api token

type AzureCluster

type AzureCluster struct {
	Name       string      `json:"name"`
	Kubeconfig interface{} `json:"kubeconfig"`
}

AzureCluster is the structure of the response for loading all AKS clusters from Microsoft Azure.

type AzureRequest

type AzureRequest struct {
	SubscriptionID string `json:"subscriptionID"`
	ClientID       string `json:"clientID"`
	ClientSecret   string `json:"clientSecret"`
	TenantID       string `json:"tenantID"`
	Admin          bool   `json:"admin"`
}

AzureRequest is the structure of a request for one of the Azure methods.

type Client

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

Client implements the structure of our API client.

func NewClient

func NewClient(syncKubeconfig bool, pluginConfig *plugins.Config, kubeClient kube.Client) *Client

NewClient returns an new API client which then can be used to register all API routes to an existing router.

func (*Client) Register

func (c *Client) Register(router *http.ServeMux)

Register takes an exting router an adds the routes for our API.

type Clusters

type Clusters struct {
	Data []struct {
		Id   string `json:"id"`
		Name string `json:"name"`
	} `json:"data"`
}

Submodel for rancher clusters

type GenerateKubeconfig

type GenerateKubeconfig struct {
	BaseType string `json:"baseType"`
	Config   string `json:"config"`
	Type     string `json:"type"`
}

Model for generating kubeconfig from rancher

type OIDCRequest

type OIDCRequest struct {
	DiscoveryURL         string `json:"discoveryURL"`
	ClientID             string `json:"clientID"`
	ClientSecret         string `json:"clientSecret"`
	CertificateAuthority string `json:"certificateAuthority"`
	RedirectURL          string `json:"redirectURL"`
	RefreshToken         string `json:"refreshToken"`
	Code                 string `json:"code"`
	Scopes               string `json:"scopes"`
	PKCEMethod           string `json:"pkceMethod"`
	Verifier             string `json:"verifier"`
}

OIDCRequest is the structure of a request for one of the OIDC methods.

type OIDCResponse

type OIDCResponse struct {
	URL          string `json:"url"`
	IDToken      string `json:"id_token"`
	RefreshToken string `json:"refresh_token"`
	AccessToken  string `json:"access_token"`
	Expiry       int64  `json:"expiry"`
	Verifier     string `json:"verifier"`
}

OIDCResponse is the structure of a response for one of the OIDC methods.

type RancherCredentialsRequest

type RancherCredentialsRequest struct {
	Username     string `json:"username"`
	Password     string `json:"password"`
	Description  string `json:"description"`
	ResponseType string `json:"responseType"`
	TTL          int    `json:"ttl"`
}

Model for logging into rancher

type RancherRequest

type RancherRequest struct {
	RancherHost string `json:"rancherHost"`
	RancherPort int    `json:"rancherPort"`
	Secure      bool   `json:"secure"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	BearerToken string `json:"bearerToken"`
	ClusterId   string `json:"clusterId"`
}

Model received from app

type Sync

type Sync struct {
	Context   string `json:"context"`
	Namespace string `json:"namespace"`
}

Sync is the structure for a sync request and contains the context or namespace as values.

type TokenObject

type TokenObject struct {
	Id    string `json:"id"`
	Token string `json:"token"`
}

Submodel for general bearer token

type Tokens

type Tokens struct {
	Data []struct {
		Id          string `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"data"`
}

Submodel for rancher bearer token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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