Skip to content

Commit 6f88fe1

Browse files
committed
add OAuth2CryptoPassphrase
Signed-off-by: Hans Zandbelt <hans.zandbelt@zmartzone.eu>
1 parent ab83bce commit 6f88fe1

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
11/13/2020
2+
- add OAuth2CryptoPassphrase
3+
14
11/10/2020
25
- allow setting a cache with OAuth2Cache
36

src/mod_oauth2.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,17 @@ static void oauth2_register_hooks(apr_pool_t *p)
325325
// ap_hook_handler(oauth2_content_handler, NULL, NULL, APR_HOOK_MIDDLE);
326326
}
327327

328+
static const char *oauth2_cfg_set_passphrase_mod(cmd_parms *cmd, void *m,
329+
const char *passphrase)
330+
{
331+
const char *rv = NULL;
332+
oauth2_apache_cfg_srv_t *srv_cfg = NULL;
333+
srv_cfg =
334+
ap_get_module_config(cmd->server->module_config, &oauth2_module);
335+
rv = oauth2_crypto_passphrase_set(srv_cfg->log, passphrase);
336+
return rv;
337+
}
338+
328339
#define OAUTH2_CFG_CMD_ARGS(nargs, cmd, member, desc) \
329340
AP_INIT_TAKE##nargs( \
330341
cmd, \
@@ -335,6 +346,11 @@ static void oauth2_register_hooks(apr_pool_t *p)
335346

336347
static const command_rec OAUTH2_APACHE_COMMANDS(oauth2)[] = {
337348

349+
OAUTH2_CFG_CMD_ARGS(1,
350+
"OAuth2CryptoPassphrase",
351+
passphrase_mod,
352+
"Set crypto passphrase."),
353+
338354
OAUTH2_CFG_CMD_ARGS(23,
339355
"OAuth2TokenVerify",
340356
token_verify,

0 commit comments

Comments
 (0)