Commit e8df6b87 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Use access tokens from the environment

Closes #4
parent 85fd3304
......@@ -34,10 +34,13 @@ var (
serviceName = app.Arg("serviceName", "Service name to ssh to").String()
accessToken = app.Flag("at", "Access Token").Short('a').Required().String()
issuerURI = app.Flag("issuer", "Issuer URI of your access token").Short('i').Default("https://unity.helmholtz-data-federation.de/oauth2").String()
feudalURI = app.Flag("uri", "Feudal URI").Short('u').Default("https://hdf-portal-dev.data.kit.edu").String()
pubKey = app.Flag("pubkey", "SSH public key file path").Short('k').Required().String()
// access token, possibly from the environment
// Envar OIDC has precedence over OIDC_AT
accessToken = app.Flag("at", "Access Token").Short('a').Envar("OIDC_AT").Envar("OIDC").Required().String()
issuerURI = app.Flag("issuer", "Issuer URI of your access token").Short('i').Default("https://unity.helmholtz-data-federation.de/oauth2").String()
feudalURI = app.Flag("uri", "Feudal URI").Short('u').Default("https://hdf-portal-dev.data.kit.edu").String()
pubKey = app.Flag("pubkey", "SSH public key file path").Short('k').Required().String()
)
func restCall(method string, path string, body io.Reader) (responseBytes []byte, err error) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment