Skip to content

Commit

Permalink
code: avoid embedding defines in macro arguments
Browse files Browse the repository at this point in the history
re-enable SonarQube

Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Dec 11, 2024
1 parent 5521109 commit 5c4d65b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
12/11/2024
- code: loop over authz arrays with index instead of pointer
- code: avoid embedding defines in macro arguments

12/10/2024
- github: add SonarQube analysis to Github workflows
Expand Down
20 changes: 12 additions & 8 deletions src/cfg/cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,19 +255,23 @@ const command_rec oidc_cfg_cmds[] = {

// cache

#ifdef USE_MEMCACHE
#define _OIDC_CMDS_CACHE_TYPE_MEMCACHE "'memcache'|"
#else
#define _OIDC_CMDS_CACHE_TYPE_MEMCACHE
#endif
#ifdef USE_LIBHIREDIS
#define _OIDC_CMDS_CACHE_TYPE_REDIS "'redis'|"
#else
#define _OIDC_CMDS_CACHE_TYPE_REDIS
#endif

AP_INIT_TAKE1(
OIDCCacheType,
oidc_cmd_cache_type_set,
NULL,
RSRC_CONF,
"cache backend must be one of ['shm'|"
#ifdef USE_MEMCACHE
"'memcache'|"
#endif
#ifdef USE_LIBHIREDIS
"'redis'|"
#endif
"'file']."),
"cache backend must be one of ['shm'|" _OIDC_CMDS_CACHE_TYPE_MEMCACHE _OIDC_CMDS_CACHE_TYPE_REDIS "'file']."),
OIDC_CFG_CMD(
AP_INIT_TAKE1,
OIDCCacheEncrypt,
Expand Down
26 changes: 13 additions & 13 deletions src/mod_auth_openidc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,28 +1665,28 @@ static int oidc_post_config(apr_pool_t *pool, apr_pool_t *p1, apr_pool_t *p2, se
return OK;
}

ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
"%s - init - cjose %s, %s, EC=%s, GCM=%s, Memcache=%s, Redis=%s, JQ=%s", NAMEVERSION,
cjose_version(), oidc_util_openssl_version(s->process->pool), OIDC_JOSE_EC_SUPPORT ? "yes" : "no",
OIDC_JOSE_GCM_SUPPORT ? "yes" : "no",
#ifdef USE_MEMCACHE
"yes"
#define _OIDC_USE_MEMCACHE "yes"
#else
"no"
#define _OIDC_USE_MEMCACHE "no"
#endif
,

#ifdef USE_LIBHIREDIS
"yes"
#define _OIDC_USE_REDIS "yes"
#else
"no"
#define _OIDC_USE_REDIS "no"
#endif
,

#ifdef USE_LIBJQ
"yes"
#define _OIDC_USE_JQ "yes"
#else
"no"
#define _OIDC_USE_JQ "no"
#endif
);

ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
"%s - init - cjose %s, %s, EC=%s, GCM=%s, Memcache=%s, Redis=%s, JQ=%s", NAMEVERSION,
cjose_version(), oidc_util_openssl_version(s->process->pool), OIDC_JOSE_EC_SUPPORT ? "yes" : "no",
OIDC_JOSE_GCM_SUPPORT ? "yes" : "no", _OIDC_USE_MEMCACHE, _OIDC_USE_REDIS, _OIDC_USE_JQ);

oidc_http_init();

Expand Down

0 comments on commit 5c4d65b

Please sign in to comment.