provider/oidc(minor): include claims in id_token

This commit is contained in:
Langhammer, Jens 2019-11-11 13:19:54 +01:00
parent 80ea7c40b7
commit 08f0aca894
2 changed files with 38 additions and 37 deletions

View File

@ -5,3 +5,4 @@ INSTALLED_APPS = [
]
OIDC_AFTER_USERLOGIN_HOOK = "passbook.providers.oidc.lib.check_permissions"
OIDC_IDTOKEN_INCLUDE_CLAIMS = True

View File

@ -302,46 +302,46 @@ LOG_PRE_CHAIN = [
structlog.processors.TimeStamper(),
]
with CONFIG.cd('log'):
LOGGING_HANDLER_MAP = {
'passbook': 'DEBUG',
'django': 'WARNING',
'celery': 'WARNING',
'grpc': 'DEBUG',
'oauthlib': 'DEBUG',
'oauth2_provider': 'DEBUG',
}
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
"plain": {
"()": structlog.stdlib.ProcessorFormatter,
"processor": structlog.processors.JSONRenderer(sort_keys=True),
"foreign_pre_chain": LOG_PRE_CHAIN,
},
"colored": {
"()": structlog.stdlib.ProcessorFormatter,
"processor": structlog.dev.ConsoleRenderer(colors=DEBUG),
"foreign_pre_chain": LOG_PRE_CHAIN,
},
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
"plain": {
"()": structlog.stdlib.ProcessorFormatter,
"processor": structlog.processors.JSONRenderer(sort_keys=True),
"foreign_pre_chain": LOG_PRE_CHAIN,
},
'handlers': {
'console': {
'level': DEBUG,
'class': 'logging.StreamHandler',
'formatter': "colored" if DEBUG else "plain",
},
"colored": {
"()": structlog.stdlib.ProcessorFormatter,
"processor": structlog.dev.ConsoleRenderer(colors=DEBUG),
"foreign_pre_chain": LOG_PRE_CHAIN,
},
'loggers': {
}
},
'handlers': {
'console': {
'level': DEBUG,
'class': 'logging.StreamHandler',
'formatter': "colored" if DEBUG else "plain",
},
},
'loggers': {
}
}
_LOGGING_HANDLER_MAP = {
'passbook': 'DEBUG',
'django': 'WARNING',
'celery': 'WARNING',
'grpc': 'DEBUG',
'oauthlib': 'DEBUG',
'oauth2_provider': 'DEBUG',
'oidc_provider': 'DEBUG',
}
for handler_name, level in _LOGGING_HANDLER_MAP.items():
LOGGING['loggers'][handler_name] = {
'handlers': ['console'],
'level': level,
'propagate': True,
}
for handler_name, level in LOGGING_HANDLER_MAP.items():
LOGGING['loggers'][handler_name] = {
'handlers': ['console'],
'level': level,
'propagate': True,
}
TEST = False
TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'