cloudshell

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: BSD-3-Clause Imports: 36 Imported by: 0

README

CloudShell

Accepts a SSH connection from Cased Shell and exchanges it for a Google CloudShell session with a single click.

Setup

Create an OAuth Application
gcloud alpha iap oauth-brands create --application_title="Cased Shell" --support_email="internal-support@example.com"
gcloud alpha iap oauth-clients create brands/cased-shell --display_name="Cased Shell"

Note the client_id and secret in the output of the last command for the next step.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(a, b []string) bool

Types

type CloudShellSSHSessionOauthHandler

type CloudShellSSHSessionOauthHandler struct {
	ShellUrl         string
	OAuthConfig      *o2.Config
	OAuth2TokenStore types.OAuth2TokenStore
	SessionEmails    types.TokenStore
}

func NewCloudShellSSHSessionOauthHandler

func NewCloudShellSSHSessionOauthHandler(shellUrl string, defaultCommand []string) *CloudShellSSHSessionOauthHandler

func (*CloudShellSSHSessionOauthHandler) DefaultCommand

func (g *CloudShellSSHSessionOauthHandler) DefaultCommand() []string

func (*CloudShellSSHSessionOauthHandler) HandleAuth

func (*CloudShellSSHSessionOauthHandler) HandleAuthCallback

func (g *CloudShellSSHSessionOauthHandler) HandleAuthCallback(w http.ResponseWriter, r *http.Request)

func (*CloudShellSSHSessionOauthHandler) HandleUser

func (*CloudShellSSHSessionOauthHandler) SSHSessionCommandHandler

func (g *CloudShellSSHSessionOauthHandler) SSHSessionCommandHandler(session ssh.Session, cmd *exec.Cmd) error

func (*CloudShellSSHSessionOauthHandler) SessionHandler

func (g *CloudShellSSHSessionOauthHandler) SessionHandler(session ssh.Session)

type CloudShellSession

type CloudShellSession interface {
	Close() error
	Connect() (*gossh.Session, error)
}

func NewCloudShellSession

func NewCloudShellSession(casedShellSession ssh.Session, tokenSource o2.TokenSource) (CloudShellSession, error)

Jump to

Keyboard shortcuts

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