@@ -37,7 +37,9 @@ export async function addRoutes({app, service} = {}) {
37
37
credentialsIssue : `${ baseUrl } ${ cfg . routes . credentialsIssue } ` ,
38
38
credentialsStatus : `${ baseUrl } ${ cfg . routes . credentialsStatus } ` ,
39
39
publishSlc : `${ baseUrl } ${ cfg . routes . publishSlc } ` ,
40
- slc : `${ baseUrl } ${ cfg . routes . slc } `
40
+ publishTerseSlc : `${ baseUrl } ${ cfg . routes . publishTerseSlc } ` ,
41
+ slc : `${ baseUrl } ${ cfg . routes . slc } ` ,
42
+ terseSlc : `${ baseUrl } ${ cfg . routes . terseSlc } `
41
43
} ;
42
44
43
45
const getConfigMiddleware = middleware . createGetConfigMiddleware ( { service} ) ;
@@ -106,7 +108,7 @@ export async function addRoutes({app, service} = {}) {
106
108
metering . reportOperationUsage ( { req} ) ;
107
109
} ) ) ;
108
110
109
- // publish the latest SLC from EDV storage
111
+ // publish the latest non-terse SLC from EDV storage
110
112
app . options ( routes . publishSlc , cors ( ) ) ;
111
113
app . post (
112
114
routes . publishSlc ,
@@ -126,7 +128,7 @@ export async function addRoutes({app, service} = {}) {
126
128
metering . reportOperationUsage ( { req} ) ;
127
129
} ) ) ;
128
130
129
- // get latest published SLC, no-authz required
131
+ // get latest published non-terse SLC, no-authz required
130
132
app . get (
131
133
routes . slc ,
132
134
cors ( ) ,
@@ -138,4 +140,39 @@ export async function addRoutes({app, service} = {}) {
138
140
const { credential} = await slcs . getFresh ( { id, config} ) ;
139
141
res . json ( credential ) ;
140
142
} ) ) ;
143
+
144
+ // publish the latest terse SLC from EDV storage
145
+ app . options ( routes . publishTerseSlc , cors ( ) ) ;
146
+ app . post (
147
+ routes . publishTerseSlc ,
148
+ cors ( ) ,
149
+ validate ( { bodySchema : publishSlcBody } ) ,
150
+ getConfigMiddleware ,
151
+ middleware . authorizeServiceObjectRequest ( ) ,
152
+ asyncHandler ( async ( req , res ) => {
153
+ const { config} = req . serviceObject ;
154
+ const { statusPurpose, listIndex} = req . params ;
155
+ const id = `${ config . id } ${ cfg . routes . terseSlcs } /` +
156
+ `${ encodeURIComponent ( statusPurpose ) } /${ listIndex } ` ;
157
+
158
+ await slcs . refresh ( { id, config} ) ;
159
+ res . sendStatus ( 204 ) ;
160
+
161
+ // meter operation usage
162
+ metering . reportOperationUsage ( { req} ) ;
163
+ } ) ) ;
164
+
165
+ // get latest published terse SLC, no-authz required
166
+ app . get (
167
+ routes . terseSlc ,
168
+ cors ( ) ,
169
+ getConfigMiddleware ,
170
+ asyncHandler ( async ( req , res ) => {
171
+ const { config} = req . serviceObject ;
172
+ const { statusPurpose, listIndex} = req . params ;
173
+ const id = `${ config . id } ${ cfg . routes . terseSlcs } /` +
174
+ `${ encodeURIComponent ( statusPurpose ) } /${ listIndex } ` ;
175
+ const { credential} = await slcs . getFresh ( { id, config} ) ;
176
+ res . json ( credential ) ;
177
+ } ) ) ;
141
178
}
0 commit comments