@@ -234,17 +234,17 @@ func craftMiddleware(opts *Opts) []middleware.Middleware {
234234 usercontext .WithAttestationContextFromAPIToken (opts .APITokenUseCase , opts .OrganizationUseCase , logHelper ),
235235 // 2.c - Set Attestation context from user token
236236 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 ),
244237 // 2.d - Set its robot account from federated delegation
245238 usercontext .WithAttestationContextFromFederatedInfo (opts .OrganizationUseCase , logHelper ),
239+ // Store all memberships in the context
240+ usercontext .WithCurrentMembershipsMiddleware (opts .MembershipUseCase ),
246241 // 3 - Update API Token last usage
247242 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 (),
248248 ).Match (requireRobotAccountMatcher ()).Build (),
249249 )
250250
0 commit comments