mirror of
https://github.com/valitydev/capi-v2.git
synced 2024-11-06 10:05:21 +00:00
TD-502: Enable usage of user_id and party_id from token (#26)
* TD-502: Enable usage of user_id and party_id from token * Fix tests
This commit is contained in:
parent
b408726bab
commit
2de9367561
@ -111,15 +111,11 @@ get_subject_id(Context) ->
|
|||||||
|
|
||||||
-spec get_user_id(processing_context()) -> binary().
|
-spec get_user_id(processing_context()) -> binary().
|
||||||
get_user_id(Context) ->
|
get_user_id(Context) ->
|
||||||
%% TODO Replace when user ids finally stop being equal to party ids
|
capi_auth:get_user_id(get_auth_context(Context)).
|
||||||
%% capi_auth:get_user_id(get_auth_context(Context)).
|
|
||||||
get_subject_id(Context).
|
|
||||||
|
|
||||||
-spec get_party_id(processing_context()) -> binary().
|
-spec get_party_id(processing_context()) -> binary().
|
||||||
get_party_id(Context) ->
|
get_party_id(Context) ->
|
||||||
%% TODO Replace when user ids finally stop being equal to party ids
|
capi_auth:get_party_id(get_auth_context(Context)).
|
||||||
%% capi_auth:get_party_id(get_auth_context(Context)).
|
|
||||||
get_subject_id(Context).
|
|
||||||
|
|
||||||
%% Utils
|
%% Utils
|
||||||
|
|
||||||
|
@ -173,13 +173,15 @@ combine_metadata(#{} = FullMetadata) ->
|
|||||||
|
|
||||||
user_session_metadata() ->
|
user_session_metadata() ->
|
||||||
genlib_map:compact(#{
|
genlib_map:compact(#{
|
||||||
|
?TK_META_PARTY_ID => ?PARTY_ID,
|
||||||
?TK_META_USER_ID => ?USER_ID,
|
?TK_META_USER_ID => ?USER_ID,
|
||||||
?TK_META_USER_EMAIL => ?USER_EMAIL
|
?TK_META_USER_EMAIL => ?USER_EMAIL
|
||||||
}).
|
}).
|
||||||
|
|
||||||
api_key_metadata() ->
|
api_key_metadata() ->
|
||||||
genlib_map:compact(#{
|
genlib_map:compact(#{
|
||||||
?TK_META_PARTY_ID => ?PARTY_ID
|
?TK_META_PARTY_ID => ?PARTY_ID,
|
||||||
|
?TK_META_USER_ID => ?USER_ID
|
||||||
}).
|
}).
|
||||||
|
|
||||||
consumer_metadata(Consumer) ->
|
consumer_metadata(Consumer) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user