-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy patht-02-test-data-firma-03-perm-01-grant.py
More file actions
executable file
·54 lines (51 loc) · 1.39 KB
/
t-02-test-data-firma-03-perm-01-grant.py
File metadata and controls
executable file
·54 lines (51 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env vpython3
import datetime
import requests
import sys
from ksefconfig import Config
def main():
cfg = Config(int(sys.argv[1]))
perms = [
{
"description": "InvoiceRead",
"premissionType": "InvoiceRead",
},
{
"description": "InvoiceWrite",
"premissionType": "InvoiceWrite",
},
{
"description": "Introspection",
"premissionType": "Introspection",
},
{
"description": "CredentialsRead",
"premissionType": "CredentialsRead",
},
{
"description": "CredentialsManage",
"premissionType": "CredentialsManage",
},
{
"description": "EnforcementOperations",
"premissionType": "EnforcementOperations",
},
{
"description": "SubunitManage",
"premissionType": "SubunitManage",
},
]
data = {
'contextIdentifier': {'type': 'nip', 'value': cfg.nip,},
'authorizedIdentifier': {'type': 'pesel', 'value': cfg.pesel,},
'permissions': [perms[0], perms[1]],
'description': f'firma: {cfg.nip}',
}
resp = requests.post(
cfg.url+'/testdata/permissions',
json=data,
timeout=5
)
print('testdata.permissions:', resp)
print('testdata.permissions:', resp.text)
main()