Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalSSH
Commits
e8df6b87
Commit
e8df6b87
authored
Feb 28, 2019
by
Lukas Burgey
Browse files
Use access tokens from the environment
Closes
#4
parent
85fd3304
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.go
View file @
e8df6b87
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment