Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ArgHelp = `
[login-target]
The login target is the base URL of the service.`
ArgHelp is the suffix text that will be displayed after the argument list in the module help
var Args = flag.NewFlagSet("login", flag.ExitOnError)
Args is a flagset that needs to be exported so that it can be written to the main program help
var Usage = `
USAGE: %s login <login-target>
login:
logs in to the SDA using the provided login target.
`
Usage text that will be displayed as command line help text when using the `help login` command
Functions ¶
Types ¶
type AuthInfo ¶
type AuthInfo struct { ClientID string `json:"client_id"` OidcURI string `json:"oidc_uri"` PublicKey string `json:"public_key"` InboxURI string `json:"inbox_uri"` }
func GetAuthInfo ¶
requests the /info endpoint to fetch the parameters needed for login
type DeviceLogin ¶
type DeviceLogin struct { BaseURL string ClientID string S3Target string PublicKey string PollingInterval int LoginResult *Result UserInfo *UserInfo CodeVerifier string // contains filtered or unexported fields }
func NewDeviceLogin ¶
func NewDeviceLogin(args []string) (DeviceLogin, error)
NewDeviceLogin() returns a new `DeviceLogin` with the given `url` and `clientID` set.
func (*DeviceLogin) GetS3Config ¶
func (login *DeviceLogin) GetS3Config() (*S3Config, error)
S3Config() returns a new `S3Config` with the values from the `DeviceLogin`
func (*DeviceLogin) Login ¶
func (login *DeviceLogin) Login() error
Login() does a full login by fetching the remote configuration, starting the login procedure, and then waiting for the user to complete login.
func (*DeviceLogin) UpdateConfigFile ¶
func (login *DeviceLogin) UpdateConfigFile() error
creates a .sda-cli-session file and updates its values
type DeviceLoginResponse ¶
type OIDCWellKnown ¶
type S3Config ¶
type S3Config struct { AccessKey string `ini:"access_key"` SecretKey string `ini:"secret_key"` AccessToken string `ini:"access_token"` HostBucket string `ini:"host_bucket"` HostBase string `ini:"host_base"` MultipartChunkSizeMb int64 `ini:"multipart_chunk_size_mb"` GuessMimeType bool `ini:"guess_mime_type"` Encoding string `ini:"encoding"` CheckSslCertificate bool `ini:"check_ssl_certificate"` CheckSslHostname bool `ini:"check_ssl_hostname"` UseHTTPS bool `ini:"use_https"` SocketTimeout int `ini:"socket_timeout"` HumanReadableSizes bool `ini:"human_readable_sizes"` PublicKey string `ini:"public_key"` }
type UserInfo ¶
type UserInfo struct { Sub string `json:"sub"` Name string `json:"name"` PreferredUsername string `json:"preferred_username"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` Ga4ghPassportV1 []string `json:"ga4gh_passport_v1"` }