Skip to content

Commit 2da7a4c

Browse files
committed
add outgoing_proxy option to verify context
correct remote_user debug printout; release 1.4.3.1 Signed-off-by: Hans Zandbelt <hans.zandbelt@zmartzone.eu>
1 parent 292d96b commit 2da7a4c

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
10/21/2021
2+
- add outgoing_proxy option to verify context
3+
- correct remote_user debug printout
4+
- release 1.4.3.1
5+
16
06/21/2021
27
- printout remote username claim when not found, for debugging purposes
38

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([liboauth2],[1.4.4-dev],[hans.zandbelt@zmartzone.eu])
1+
AC_INIT([liboauth2],[1.4.3.1],[hans.zandbelt@zmartzone.eu])
22

33
AM_INIT_AUTOMAKE([foreign no-define subdir-objects])
44
AC_CONFIG_MACRO_DIR([m4])

src/jose.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,12 +606,14 @@ bool oauth2_jose_hash2s(oauth2_log_t *log, const char *digest, const char *src,
606606

607607
_OAUTH2_CFG_CTX_INIT_START(oauth2_uri_ctx)
608608
ctx->endpoint = NULL;
609+
ctx->outgoing_proxy = NULL;
609610
ctx->cache = NULL;
610611
ctx->expiry_s = OAUTH2_CFG_UINT_UNSET;
611612
_OAUTH2_CFG_CTX_INIT_END
612613

613614
_OAUTH2_CFG_CTX_CLONE_START(oauth2_uri_ctx)
614615
dst->endpoint = oauth2_cfg_endpoint_clone(log, src->endpoint);
616+
dst->outgoing_proxy = oauth2_strdup(src->outgoing_proxy);
615617
dst->cache = src->cache;
616618
dst->expiry_s = src->expiry_s;
617619
_OAUTH2_CFG_CTX_CLONE_END
@@ -1739,6 +1741,11 @@ char *oauth2_jose_options_uri_ctx(oauth2_log_t *log, const char *value,
17391741
ctx->endpoint = oauth2_cfg_endpoint_init(log);
17401742
rv = oauth2_cfg_set_endpoint(log, ctx->endpoint, value, params, prefix);
17411743

1744+
key = oauth2_stradd(NULL, prefix, ".", "outgoing_proxy");
1745+
ctx->outgoing_proxy =
1746+
oauth2_strdup(oauth2_nv_list_get(log, params, key));
1747+
oauth2_mem_free(key);
1748+
17421749
key = oauth2_stradd(NULL, prefix, ".", "cache");
17431750
ctx->cache =
17441751
oauth2_cache_obtain(log, oauth2_nv_list_get(log, params, key));
@@ -2022,6 +2029,8 @@ char *oauth2_jose_resolve_from_uri(oauth2_log_t *log, oauth2_uri_ctx_t *uri_ctx,
20222029
oauth2_http_call_ctx_ssl_verify_set(
20232030
log, ctx,
20242031
oauth2_cfg_endpoint_get_ssl_verify(uri_ctx->endpoint));
2032+
oauth2_http_call_ctx_outgoing_proxy_set(
2033+
log, ctx, uri_ctx->outgoing_proxy);
20252034

20262035
rc = oauth2_http_get(
20272036
log, oauth2_cfg_endpoint_get_url(uri_ctx->endpoint), NULL,

src/jose_int.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef struct oauth2_jose_jwk_list_t {
4040

4141
typedef struct oauth2_uri_ctx_t {
4242
oauth2_cfg_endpoint_t *endpoint;
43+
char *outgoing_proxy;
4344
oauth2_cache_t *cache;
4445
oauth2_time_t expiry_s;
4546
} oauth2_uri_ctx_t;

src/server/apache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ bool oauth2_apache_set_request_user(oauth2_cfg_target_pass_t *target_pass,
731731
apr_pstrdup(ctx->r->pool, json_string_value(remote_user));
732732

733733
oauth2_debug(ctx->log, "set user to \"%s\" based on claim: %s=%s",
734-
ctx->r->user, claim, remote_user);
734+
ctx->r->user, claim, json_string_value(remote_user));
735735

736736
// TODO: more flexibility and or regular expressions?
737737

0 commit comments

Comments
 (0)