@@ -234,17 +234,17 @@ func craftMiddleware(opts *Opts) []middleware.Middleware {
234
234
usercontext .WithAttestationContextFromAPIToken (opts .APITokenUseCase , opts .OrganizationUseCase , logHelper ),
235
235
// 2.c - Set Attestation context from user token
236
236
usercontext .WithAttestationContextFromUser (opts .UserUseCase , logHelper ),
237
- // Validate the CAS Backend is fully configured and valid
238
- selector .Server (
239
- usercontext .ValidateCASBackend (opts .CASBackendUseCase ),
240
- usercontext .BlockIfCASBackendNotValid (opts .CASBackendUseCase ),
241
- ).Match (requireFullyConfiguredCASBackendMatcher ()).Build (),
242
- // Store all memberships in the context
243
- usercontext .WithCurrentMembershipsMiddleware (opts .MembershipUseCase ),
244
237
// 2.d - Set its robot account from federated delegation
245
238
usercontext .WithAttestationContextFromFederatedInfo (opts .OrganizationUseCase , logHelper ),
239
+ // Store all memberships in the context
240
+ usercontext .WithCurrentMembershipsMiddleware (opts .MembershipUseCase ),
246
241
// 3 - Update API Token last usage
247
242
usercontext .WithAPITokenUsageUpdater (opts .APITokenUseCase , logHelper ),
243
+ // 4 - Validate the CAS Backend is fully configured and valid
244
+ selector .Server (
245
+ usercontext .ValidateCASBackend (opts .CASBackendUseCase ),
246
+ usercontext .BlockIfCASBackendNotValid (opts .CASBackendUseCase ),
247
+ ).Match (requireFullyConfiguredCASBackendMatcher ()).Build (),
248
248
).Match (requireRobotAccountMatcher ()).Build (),
249
249
)
250
250
0 commit comments