From ae72bc87055c28e987fb5e502166cecd5d210cdf Mon Sep 17 00:00:00 2001 From: Haresh Kainth Date: Tue, 4 Oct 2022 10:51:34 +0100 Subject: [PATCH] chore:removed enabled flag --- authorisation/config.go | 1 - authorisation/middleware.go | 4 ---- 2 files changed, 5 deletions(-) diff --git a/authorisation/config.go b/authorisation/config.go index 5ddd433..ebdd0df 100644 --- a/authorisation/config.go +++ b/authorisation/config.go @@ -17,7 +17,6 @@ type Config struct { // NewDefaultConfig populates the config struct with default values suitable for local development. func NewDefaultConfig() *Config { return &Config{ - Enabled: true, JWTVerificationPublicKeys: map[string]string{"NeKb65194Jo=": "MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TpTemKodQNChMNj1f/NF19nMAbjKbwRENSKujO5iwXLIt0hCjh5dz4egKQo7KEr2ex3qdy50LWKD871gRfAgDoRD5/1kUUVqII5K09IDCVY/EohukrI+Uep/Z5ymPNPXXD1yJvBx/YmmuMGUAT5UKHKBCP+FcoAxYAKcaKhtL0iyVjhtD0Y4V8gcQnQq3bOYhF4FEHoHBNh23AKcJM1VvNVtSHViMuTOzsFLHAgy2lLsRLnxtXovEovAiTay+Sn1FuDOq2gswl2Uujh1GO8kfkXE1gNRn/l7RUYIRrql8kROHMSYvPBAIqYhGSWOG3JX1oFlI1erYaeIPI4l4Qj/P+YSnrRx0di3vy6ZDAnhs8kdZP81F+3rFrNUNIOVFBRKscMnvOH4HO4f9PpXynde5xTlVvqdgXVlWkxGgQk0d323ka8fPY1xsmxV99idmmgmfglPOeLxuOkFxfXJSpbP/kn9AEyKBcF2BImfc12uvdSn46zZ1f/8nvzQ9naruwEtho4t6cIb7A+5KxVAILCQHvm3xIxfxMy5RFIeR7T3KhW2URDtiGMKuEE44EQwtxXxnMUdmvBUyHg2iQ54ELD4uVVVkGZkT5cTIf8iwfWI808B+CE5T8I3YrK7DiaVkJqTWX9LqWqetwHQxY48iTN+nPguHQ6dkZwmxuWBEuQ9eECAwEAAQ=="}, PermissionsAPIURL: "http://localhost:25400", ZebedeeURL: "http://localhost:8082", diff --git a/authorisation/middleware.go b/authorisation/middleware.go index 2503b0a..087c1cb 100644 --- a/authorisation/middleware.go +++ b/authorisation/middleware.go @@ -43,10 +43,6 @@ type GetAttributesFromRequest func(req *http.Request) (attributes map[string]str // NewFeatureFlaggedMiddleware returns a different Middleware implementation depending on the configured feature flag value // Use this constructor when first adding authorisation as middleware so that it can be toggled off if required. func NewFeatureFlaggedMiddleware(ctx context.Context, config *Config, jwtRSAPublicKeys map[string]string) (Middleware, error) { - if config.Enabled { - return NewMiddlewareFromConfig(ctx, config, jwtRSAPublicKeys) - } - return NewNoopMiddleware(), nil }