File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
app/controlplane/internal/server Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,8 @@ func craftMiddleware(opts *Opts) []middleware.Middleware {
190190 // 4 - Make sure the account is fully functional
191191 selector .Server (
192192 usercontext .CheckUserInAllowList (opts .AuthConfig .AllowList ),
193+ ).Match (allowListEnabled ()).Build (),
194+ selector .Server (
193195 usercontext .CheckOrgRequirements (opts .CASBackendUseCase ),
194196 ).Match (requireFullyConfiguredOrgMatcher ()).Build (),
195197 ).Match (requireCurrentUserMatcher ()).Build (),
@@ -235,6 +237,15 @@ func requireFullyConfiguredOrgMatcher() selector.MatchFunc {
235237 }
236238}
237239
240+ func allowListEnabled () selector.MatchFunc {
241+ // the allow list should not affect the ability to know who you are and delete your account
242+ const skipRegexp = "controlplane.v1.ContextService/Current|/controlplane.v1.AuthService/DeleteAccount"
243+ return func (ctx context.Context , operation string ) bool {
244+ r := regexp .MustCompile (skipRegexp )
245+ return ! r .MatchString (operation )
246+ }
247+ }
248+
238249func requireRobotAccountMatcher () selector.MatchFunc {
239250 const requireMatcher = "controlplane.v1.AttestationService/.*|controlplane.v1.AttestationStateService/.*|controlplane.v1.SigningService/.*"
240251 return func (ctx context.Context , operation string ) bool {
You can’t perform that action at this time.
0 commit comments