Skip to content

Commit aa5251e

Browse files
committed
refactor: Simplify UMA server configurations
1 parent 01f9259 commit aa5251e

5 files changed

Lines changed: 16 additions & 165 deletions

File tree

packages/uma/config/default.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
],
66
"import": [
77
"sai-uma:config/credentials/verifiers/default.json",
8-
"sai-uma:config/dialog/negotiators/contract.json",
8+
"sai-uma:config/dialog/negotiators/default.json",
99
"sai-uma:config/policies/authorizers/default.json",
1010
"sai-uma:config/resources/storage/default.json",
1111
"sai-uma:config/routes/discovery.json",
1212
"sai-uma:config/routes/introspection.json",
1313
"sai-uma:config/routes/keys.json",
1414
"sai-uma:config/routes/resources.json",
1515
"sai-uma:config/routes/tickets.json",
16-
"sai-uma:config/routes/tokens_contract.json",
16+
"sai-uma:config/routes/tokens.json",
1717
"sai-uma:config/routes/log.json",
1818
"sai-uma:config/routes/vc.json",
1919
"sai-uma:config/routes/contract.json",
@@ -96,14 +96,14 @@
9696
"routes": [
9797
{ "@id": "urn:uma:default:UmaConfigRoute" },
9898
{ "@id": "urn:uma:default:JwksRoute" },
99-
{ "@id": "urn:uma:default:DemoTokenRoute" },
99+
{ "@id": "urn:uma:default:TokenRoute" },
100100
{ "@id": "urn:uma:default:PermissionRegistrationRoute" },
101101
{ "@id": "urn:uma:default:ResourceRegistrationRoute" },
102102
{ "@id": "urn:uma:default:ResourceRegistrationOpsRoute" },
103103
{ "@id": "urn:uma:default:IntrospectionRoute" },
104-
{ "@id": "urn:uma:default:LogRoute" },
105-
{ "@id": "urn:uma:default:VCRoute" },
106-
{ "@id": "urn:uma:default:ContractRoute" }
104+
{ "@id": "urn:uma:default:LogRoute" },
105+
{ "@id": "urn:uma:default:VCRoute" },
106+
{ "@id": "urn:uma:default:ContractRoute" }
107107
],
108108
"defaultHandler": {
109109
"@type": "DefaultRequestHandler"

packages/uma/config/dialog/negotiators/contract.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/uma/config/odrl.json

Lines changed: 10 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,22 @@
11
{
22
"@context": [
3-
"https://linkedsoftwaredependencies.org/bundles/npm/@solidlab/uma/^0.0.0/components/context.jsonld",
4-
"https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^7.0.0/components/context.jsonld"
3+
"https://linkedsoftwaredependencies.org/bundles/npm/@solidlab/uma/^0.0.0/components/context.jsonld"
54
],
65
"import": [
7-
"sai-uma:config/credentials/verifiers/default.json",
8-
"sai-uma:config/dialog/negotiators/contract.json",
9-
"sai-uma:config/policies/authorizers/odrl.json",
10-
"sai-uma:config/resources/storage/default.json",
11-
"sai-uma:config/routes/discovery.json",
12-
"sai-uma:config/routes/introspection.json",
13-
"sai-uma:config/routes/keys.json",
14-
"sai-uma:config/routes/resources.json",
15-
"sai-uma:config/routes/tickets.json",
16-
"sai-uma:config/routes/tokens_contract.json",
17-
"sai-uma:config/routes/log.json",
18-
"sai-uma:config/routes/vc.json",
19-
"sai-uma:config/routes/contract.json",
20-
"sai-uma:config/tickets/storage/default.json",
21-
"sai-uma:config/tickets/strategy/immediate-authorizer.json",
22-
"sai-uma:config/tokens/factory/default.json",
23-
"sai-uma:config/tokens/storage/default.json",
24-
"sai-uma:config/variables/default.json"
6+
"sai-uma:config/default.json"
257
],
268
"@graph": [
279
{
28-
"@id": "urn:uma:default:NodeHttpServer",
29-
"@type": "ServerInitializer",
30-
"port": {
31-
"@id": "urn:uma:variables:port"
32-
},
33-
"serverFactory": {
34-
"@id": "urn:uma:default:ServerFactory",
35-
"@type": "BaseServerFactory",
36-
"configurator": {
37-
"comment": "Handles all request events from the server.",
38-
"@id": "urn:uma:default:HandlerServerConfigurator",
39-
"@type": "HandlerServerConfigurator",
40-
"handler": {
41-
"@id": "urn:uma:default:NodeHttpRequestResponseHandler"
42-
}
10+
"@id": "urn:uma:demo:Authorizer",
11+
"@type": "Override",
12+
"overrideInstance": { "@id": "urn:uma:default:Authorizer" },
13+
"overrideParameters": {
14+
"@type": "OdrlAuthorizer",
15+
"eyePath": { "@id": "urn:uma:variables:eyePath" },
16+
"policies": {
17+
"@id": "urn:uma:default:RulesStorage"
4318
}
4419
}
45-
},
46-
{
47-
"@id": "urn:uma:default:HttpHandler",
48-
"@type": "SequenceHandler",
49-
"handlers": [
50-
{
51-
"comment": "Adds all the necessary CORS headers.",
52-
"@id": "urn:uma:default:CorsHandler",
53-
"@type": "CorsHandler",
54-
"options_methods": [
55-
"GET",
56-
"HEAD",
57-
"OPTIONS",
58-
"POST",
59-
"PUT",
60-
"PATCH",
61-
"DELETE"
62-
],
63-
"options_credentials": true,
64-
"options_preflightContinue": false,
65-
"options_exposedHeaders": [
66-
"Allow",
67-
"ETag",
68-
"Last-Modified",
69-
"Link",
70-
"Location",
71-
"Updates-Via",
72-
"Www-Authenticate"
73-
]
74-
},
75-
{
76-
"@id": "urn:uma:default:NodeHttpRequestResponseHandler"
77-
}
78-
]
79-
},
80-
{
81-
"@id": "urn:uma:default:NodeHttpRequestResponseHandler",
82-
"@type": "NodeHttpRequestResponseHandler",
83-
"targetExtractor": {
84-
"@type": "BaseTargetExtractor",
85-
"includeQueryString": true
86-
},
87-
"httpHandler": {
88-
"@id": "urm:uma:default:JsonHttpErrorHandler",
89-
"@type": "JsonHttpErrorHandler",
90-
"handler": {
91-
"@id": "urm:uma:default:JsonFormHttpHandler",
92-
"@type": "JsonFormHttpHandler",
93-
"handler": {
94-
"@id": "urn:uma:default:RoutedHttpRequestHandler",
95-
"@type": "RoutedHttpRequestHandler",
96-
"routes": [
97-
{ "@id": "urn:uma:default:UmaConfigRoute" },
98-
{ "@id": "urn:uma:default:JwksRoute" },
99-
{ "@id": "urn:uma:default:DemoTokenRoute" },
100-
{ "@id": "urn:uma:default:PermissionRegistrationRoute" },
101-
{ "@id": "urn:uma:default:ResourceRegistrationRoute" },
102-
{ "@id": "urn:uma:default:ResourceRegistrationOpsRoute" },
103-
{ "@id": "urn:uma:default:IntrospectionRoute" },
104-
{ "@id": "urn:uma:default:LogRoute" },
105-
{ "@id": "urn:uma:default:VCRoute" },
106-
{ "@id": "urn:uma:default:ContractRoute" }
107-
],
108-
"defaultHandler": {
109-
"@type": "DefaultRequestHandler"
110-
}
111-
}
112-
}
113-
}
114-
},
115-
{
116-
"comment": "Configuration for the UMA AS."
11720
}
11821
]
11922
}

packages/uma/config/policies/authorizers/odrl.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/uma/config/routes/tokens_contract.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)