@@ -124,27 +124,6 @@ it.layer(NodeServices.layer)("PairingGrantStore.layer", (it) => {
124124 } ) . pipe ( Effect . provide ( layerPairingGrantStore ( ) ) ) ,
125125 ) ;
126126
127- it . effect ( "seeds the desktop bootstrap credential as a reusable grant" , ( ) =>
128- Effect . gen ( function * ( ) {
129- const bootstrapCredentials = yield * PairingGrantStore . PairingGrantStore ;
130- const first = yield * bootstrapCredentials . consume ( "desktop-bootstrap-token" ) ;
131- const second = yield * bootstrapCredentials . consume ( "desktop-bootstrap-token" ) ;
132- const third = yield * bootstrapCredentials . consume ( "desktop-bootstrap-token" ) ;
133-
134- expect ( first . method ) . toBe ( "desktop-bootstrap" ) ;
135- expect ( first . scopes ) . toEqual ( AuthStandardClientScopes ) ;
136- expect ( first . subject ) . toBe ( "desktop-bootstrap" ) ;
137- expect ( second . method ) . toBe ( "desktop-bootstrap" ) ;
138- expect ( third . method ) . toBe ( "desktop-bootstrap" ) ;
139- } ) . pipe (
140- Effect . provide (
141- layerPairingGrantStore ( {
142- desktopBootstrapToken : "desktop-bootstrap-token" ,
143- } ) ,
144- ) ,
145- ) ,
146- ) ;
147-
148127 it . effect ( "reports seeded desktop bootstrap credentials as expired after their ttl" , ( ) =>
149128 Effect . gen ( function * ( ) {
150129 const bootstrapCredentials = yield * PairingGrantStore . PairingGrantStore ;
@@ -228,31 +207,4 @@ it.layer(NodeServices.layer)("PairingGrantStore.layer", (it) => {
228207 }
229208 } ) . pipe ( Effect . scoped , Effect . provide ( layerPairingGrantStore ( ) ) ) ,
230209 ) ;
231-
232- it . effect ( "lists and revokes active pairing links" , ( ) =>
233- Effect . gen ( function * ( ) {
234- const bootstrapCredentials = yield * PairingGrantStore . PairingGrantStore ;
235- const first = yield * bootstrapCredentials . issueOneTimeToken ( ) ;
236- const second = yield * bootstrapCredentials . issueOneTimeToken ( {
237- scopes : [ "orchestration:read" , "access:write" ] ,
238- } ) ;
239-
240- const activeBeforeRevoke = yield * bootstrapCredentials . listActive ( ) ;
241- expect ( activeBeforeRevoke . map ( ( entry ) => entry . id ) ) . toContain ( first . id ) ;
242- expect ( activeBeforeRevoke . map ( ( entry ) => entry . id ) ) . toContain ( second . id ) ;
243- for ( const entry of activeBeforeRevoke ) {
244- expect ( entry ) . not . toHaveProperty ( "credential" ) ;
245- }
246-
247- const revoked = yield * bootstrapCredentials . revoke ( first . id ) ;
248- const activeAfterRevoke = yield * bootstrapCredentials . listActive ( ) ;
249- const revokedConsume = yield * Effect . flip ( bootstrapCredentials . consume ( first . credential ) ) ;
250-
251- expect ( revoked ) . toBe ( true ) ;
252- expect ( activeAfterRevoke . map ( ( entry ) => entry . id ) ) . not . toContain ( first . id ) ;
253- expect ( activeAfterRevoke . map ( ( entry ) => entry . id ) ) . toContain ( second . id ) ;
254- expect ( revokedConsume . message ) . toContain ( "no longer available" ) ;
255- expect ( revokedConsume . _tag ) . toBe ( "UnavailableBootstrapCredentialError" ) ;
256- } ) . pipe ( Effect . provide ( layerPairingGrantStore ( ) ) ) ,
257- ) ;
258210} ) ;
0 commit comments