README.md 2.33 KB
Newer Older
ubedv's avatar
ubedv committed
1 2 3 4 5 6 7
FEUDAL Scripts
=

FEUDAL scripts are executed by a FEUDAL client to facilitate the customized deployment process 
of an arbitrary service. 

They use the JSON encoding for input and output. The specific formats are outlined below.
8
Schema files for [input](schema-input.json) and [output](schema-output.json) are also available.
ubedv's avatar
ubedv committed
9 10


ubedv's avatar
ubedv committed
11
Input Format
ubedv's avatar
ubedv committed
12
-
ubedv's avatar
ubedv committed
13
```
ubedv's avatar
ubedv committed
14
{
ubedv's avatar
ubedv committed
15 16 17 18
    // The state which is to be reached by this script execution
    //
    // deployed     -> the script is supposed to deploy the user
    // not_deployed -> the script is supposed to remove the user 
ubedv's avatar
ubedv committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
    "state_target": "deployed" or "not_deployed",
    
    
    "user": {
        "userinfo": <OpenID Connect userinfo as json dict>
    },
    
    // The credentials from the user, which need to be deployed
    // The dict maps a credential type to a list of credentials of this type.
    "credentials": {
        "ssh_key": [
            {
                "name": "unity_key",
                "value": "ssh-... ..."
            }
        ]
    },
    
    // Answers to a previously requested questionnaire
    "questionnaire": {
        "question_name": "user answer to this question"
    }
}
ubedv's avatar
ubedv committed
42
```
ubedv's avatar
ubedv committed
43 44


ubedv's avatar
ubedv committed
45
Output Format
ubedv's avatar
ubedv committed
46
-
ubedv's avatar
ubedv committed
47
```
ubedv's avatar
ubedv committed
48
{
ubedv's avatar
ubedv committed
49 50 51 52 53 54 55
    // The state as of now (after the script run)
    //
    // deployed     -> The deployment was processed successfully
    // not_deployed -> The removal of the user was processed successfully
    // failed       -> An error occured and the script could not reach the 'state_target' from the Input
    // rejected     -> The user is not permitted to use this service, for whatever reason
    // questionnaire-> The script needs more information to deploy the user
ubedv's avatar
ubedv committed
56 57 58 59 60 61 62 63 64 65 66 67
    "state": "deployed" or "not_deployed" or "failed" or "rejected" or "questionnaire",
    
    
    "message": "<message for the user, in case state is 'failed' or 'rejected'>",
    
    // In case we need more info from the user: set state to "questionnaire" and put 
    // questions in this dictionary.
    // The user can answer these questions (and we will receive the answers some input in the future) 
    "questionnaire": {
        "question_name": "question"
    },
    
ubedv's avatar
ubedv committed
68
    // additional credentials and instructions, the user needs to access the service (in addition to her credentials from the Input)
ubedv's avatar
ubedv committed
69 70 71 72 73
    // an example would be the user name of the provisioned user.
    "credentials": {
        "key": "value"
    }
}
74
```