change: change log-query string value to bool
BREAKING CHANGE As discussed on https://github.com/PostgREST/postgrest/issues/3934#issuecomment-3362806777, this changes log-query to use a bool value, this: - Simplifies config for users. - Reduces effort in testing the different combinations. Closes #3934
This commit is contained in:
committed by
Steve Chavez
parent
e4458abd33
commit
09b088d8ff
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = true
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = true
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = true
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = false
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = false
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = false
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = false
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = false
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = false
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = "ODERREALLYREALLYREALLYREALLYVERYSAFE"
|
||||
jwt-secret-is-base64 = false
|
||||
jwt-cache-max-entries = 86400
|
||||
log-level = "info"
|
||||
log-query = "main-query"
|
||||
log-query = true
|
||||
openapi-mode = "disabled"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = "https://otherexample.org/api"
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = "OVERRIDE=REALLY=REALLY=REALLY=REALLY=VERY=SAFE"
|
||||
jwt-secret-is-base64 = false
|
||||
jwt-cache-max-entries = 86400
|
||||
log-level = "info"
|
||||
log-query = "main-query"
|
||||
log-query = true
|
||||
openapi-mode = "ignore-privileges"
|
||||
openapi-security-active = true
|
||||
openapi-server-proxy-uri = "https://example.org/api"
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = "c2VjdXJpdHl0aHJvdWdob2JzY3VyaXR5aW5iYXNlNjQ="
|
||||
jwt-secret-is-base64 = true
|
||||
jwt-cache-max-entries = 86400
|
||||
log-level = "info"
|
||||
log-query = "main-query"
|
||||
log-query = true
|
||||
openapi-mode = "ignore-privileges"
|
||||
openapi-security-active = true
|
||||
openapi-server-proxy-uri = "https://postgrest.org"
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = ""
|
||||
jwt-secret-is-base64 = false
|
||||
jwt-cache-max-entries = 1000
|
||||
log-level = "error"
|
||||
log-query = "disabled"
|
||||
log-query = false
|
||||
openapi-mode = "follow-privileges"
|
||||
openapi-security-active = false
|
||||
openapi-server-proxy-uri = ""
|
||||
|
||||
@@ -28,7 +28,7 @@ PGRST_JWT_SECRET: c2VjdXJpdHl0aHJvdWdob2JzY3VyaXR5aW5iYXNlNjQ=
|
||||
PGRST_JWT_SECRET_IS_BASE64: true
|
||||
PGRST_JWT_CACHE_MAX_ENTRIES: 86400
|
||||
PGRST_LOG_LEVEL: info
|
||||
PGRST_LOG_QUERY: 'main-query'
|
||||
PGRST_LOG_QUERY: true
|
||||
PGRST_OPENAPI_MODE: 'ignore-privileges'
|
||||
PGRST_OPENAPI_SECURITY_ACTIVE: true
|
||||
PGRST_OPENAPI_SERVER_PROXY_URI: 'https://postgrest.org'
|
||||
|
||||
@@ -25,7 +25,7 @@ jwt-secret = "c2VjdXJpdHl0aHJvdWdob2JzY3VyaXR5aW5iYXNlNjQ="
|
||||
jwt-secret-is-base64 = true
|
||||
jwt-cache-max-entries = 86400
|
||||
log-level = "info"
|
||||
log-query = "main-query"
|
||||
log-query = true
|
||||
openapi-mode = "ignore-privileges"
|
||||
openapi-security-active = true
|
||||
openapi-server-proxy-uri = "https://postgrest.org"
|
||||
|
||||
+1
-1
@@ -1013,7 +1013,7 @@ def test_log_query(level, defaultenv):
|
||||
env = {
|
||||
**defaultenv,
|
||||
"PGRST_LOG_LEVEL": level,
|
||||
"PGRST_LOG_QUERY": "main-query",
|
||||
"PGRST_LOG_QUERY": "true",
|
||||
}
|
||||
|
||||
with run(env=env) as postgrest:
|
||||
|
||||
@@ -33,7 +33,6 @@ import Data.String (String)
|
||||
import PostgREST.Config (AppConfig (..),
|
||||
JSPathExp (..),
|
||||
LogLevel (..),
|
||||
LogQuery (..),
|
||||
OpenAPIMode (..),
|
||||
parseSecret)
|
||||
import PostgREST.SchemaCache.Identifiers (QualifiedIdentifier (..))
|
||||
@@ -142,7 +141,7 @@ baseCfg = let secret = encodeUtf8 "reallyreallyreallyreallyverysafe" in
|
||||
, configJwtSecretIsBase64 = False
|
||||
, configJwtCacheMaxEntries = 10
|
||||
, configLogLevel = LogCrit
|
||||
, configLogQuery = LogQueryDisabled
|
||||
, configLogQuery = False
|
||||
, configOpenApiMode = OAFollowPriv
|
||||
, configOpenApiSecurityActive = False
|
||||
, configOpenApiServerProxyUri = Nothing
|
||||
|
||||
Reference in New Issue
Block a user