-
Notifications
You must be signed in to change notification settings - Fork 8
/
snippets.txt
85 lines (64 loc) · 1.99 KB
/
snippets.txt
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
CLI:
---
cf api
cf login
cf target
cf services
cf apps
cf mtas
cf app MTAppBackend (to see routes)
cf env MTAppBackend (to see VCAP_SERVICES.xsuaa.credentials.xsappname)
cf create-service saas-registry application MTAppRegistry -c registry-config.json
cf update-service MTAppRegistry -c registry-config.json
cf bind-service MTAppBackend MTAppRegistry
cf restage MTAppBackend
cf routes
cf map-route MTAppRouter cfapps.eu10.hana.ondemand.com --hostname <subdomain>-trial-dev-mtapprouter
cf delete-route cfapps.eu10.hana.ondemand.com --hostname <subdomain>-trial-dev-mtapprouter -f
REST API:
--------
cf env MTAppBackend (to see VCAP_SERVICES.saas-registry.credentials: url (for auth), saas_registry_url, clientid, clientsecret)
authentication:
POST /oauth/token?grant_type=client_credentials&response_type=token
tests: pm.environment.set("token", "Bearer " + JSON.parse(responseBody).access_token);
view app subscribers:
GET /api/v2.0/subscription
onboarding/subscribe:
PUT /api/v2.0/subscription/tenants/<subaccountid>?jobUuid=<guid> (content-type: application/json, body: {"subdomain":"<subdomain>"})
GET /api/v2.0/jobs/<jobid>
offboarding/unsubscribe:
DELETE /api/v2.0/subscription/tenants/<tenantid>?jobUuid=<guid>
GET /api/v2.0/jobs/<jobid>
Uninstall:
---------
offboard all tenants first!
cf services
cf apps
cf mtas
cf service MTAppRegistry
cf unbind-service MTAppBackend MTAppRegistry
cf delete-service MTAppRegistry -f
cf undeploy MTApp --delete-services -f
Authorizations:
--------------
xs-security.json:
}, {
"name": "$XSAPPNAME.User",
"description": "User"
}, {
"name": "$XSAPPNAME.Administrator",
"description": "Administrator"
}],
"role-templates": [{
"name": "user",
"description": "User Role",
"scope-references": ["$XSAPPNAME.User"]
}, {
"name": "administrator",
"description": "Administrator Role",
"scope-references": ["$XSAPPNAME.Administrator", "$XSAPPNAME.User"]
server.js:
if (req.authInfo.checkScope("$XSAPPNAME.User")) {
} else {
res.status(403).send("Forbidden");
}