Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
feudal
feudalScripts
Commits
456d73af
Commit
456d73af
authored
Nov 15, 2018
by
Lukas Burgey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt to adjustments at the API
parent
3e9845b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
scripts.go
scripts.go
+15
-20
No files found.
scripts.go
View file @
456d73af
...
...
@@ -6,14 +6,9 @@ import (
)
type
(
// SSHKey of a user
SSHKey
struct
{
Name
string
`json:"name"`
Key
string
`json:"key"`
}
// Credential is currently a ssh key, but may be a password hash in the future
Credential
struct
{
ID
int
`json:"id,omitempty"`
Type
string
`json:"type,omitempty"`
Name
string
`json:"name"`
Value
string
`json:"value"`
...
...
@@ -23,6 +18,9 @@ type (
// after the script run
UserCredentialStates
map
[
string
]
map
[
string
]
State
// UserCredentials maps a credential type to the credentials of this type
UserCredentials
map
[
string
][]
Credential
// Group a group of which User is a member of
Group
struct
{
Name
string
`json:"name"`
...
...
@@ -33,11 +31,11 @@ type (
// User describes the user info
User
struct
{
//
TODO maybe just handover the raw userinfo
Email
string
`json:"
email
"`
// TODO maybe just handover the raw userinfo
//Groups []Group
`json:"
groups
"`
UserInfo
UserInfo
`json:"userinfo
"`
//
Email string `json:"email"`
// Groups []Group
`json:"
groups
"`
UserInfo
UserInfo
`json:"
userinfo
"`
Credentials
UserCredentials
`json:"credentials,omitempty
"`
}
// Input of the deployment script
...
...
@@ -51,13 +49,14 @@ type (
// Credentials the credentials to deploy
// maps the credential type to the according credentials
Credentials
map
[
string
][]
Credential
`json:"credentials"`
// TODO this should move into Input.User
Credentials
UserCredentials
`json:"credentials,omitempty"`
// Questionnaire is an answered questionnaire
// Maps a question name to the answer of the user
// The keys (question names) *must* be identical to those of the Output.Questionnaire
// containing the questions
Questionnaire
map
[
string
]
string
`json:"questionnaire"`
Questionnaire
map
[
string
]
string
`json:"questionnaire
,omitempty
"`
}
// Output of the deployment script
...
...
@@ -74,17 +73,17 @@ type (
// Questionnaire requested by the script
// Ignored when State is not Questionnaire
// Maps a question name to a description of the question
Questionnaire
map
[
string
]
string
`json:"questionnaire"`
Questionnaire
map
[
string
]
string
`json:"questionnaire
,omitempty
"`
// Credentials for the user
// Ignored when State is not Deployed
// Maps a credential name to a credential value
Credentials
map
[
string
]
string
`json:"credentials"`
Credentials
map
[
string
]
string
`json:"credentials
,omitempty
"`
// UserCredentialStates states of the credentials provided by the user (not by the script!)
// This field is not mandatory! The client will assume that all credentials have the State
// Output.State if this is not given
UserCredentialStates
UserCredentialStates
`json:"user_credential_states"`
UserCredentialStates
UserCredentialStates
`json:"user_credential_states
,omitempty
"`
}
// State is a string enum
...
...
@@ -123,10 +122,6 @@ func (u User) String() string {
return
""
}
func
(
k
SSHKey
)
String
()
string
{
return
k
.
Name
}
func
(
i
Input
)
String
()
string
{
iBytes
,
err
:=
i
.
Marshal
()
if
err
!=
nil
{
...
...
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