Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-rc.21'
Browse files Browse the repository at this point in the history
  • Loading branch information
aramallo committed Jun 17, 2024
2 parents 6681d12 + dfd373c commit 3db37ac
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 13 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# CHANGELOG
## 1.0.0-rc.21
### Fixed
* Fix checking user credentials changes in `on_merge` (#31)
* Fixes several bugs reported in #30:
* Missing `authroles` in WAMP context for Oauth2 flow
* Pattern matching exception in Bondy Dealer where the atom `no_proc` was wrongly used instead of `noproc`
* Fix in bondy Oauth2 un be able to handle undefined as a "token_type" in the `revoke_token` operation

## 1.0.0-rc.20
* Drop Min OTP version to OTP25 and CI workflow to publish Bondy build with OTP25 and OTP26

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![Docker Pulls](https://img.shields.io/docker/pulls/leapsight/bondy?style=for-the-badge)
![Docker Build (master)](https://img.shields.io/github/actions/workflow/status/bondy-io/bondy/docker_image_build.yaml?&branch=master&label=docker-master&style=for-the-badge)
![Docker Build (develop)](https://img.shields.io/github/actions/workflow/status/bondy-io/bondy/docker_image_build.yaml?&branch=develop&label=docker-develop&style=for-the-badge)
![Docker Build (latest-tag)](https://img.shields.io/github/actions/workflow/status/bondy-io/bondy/docker_image_build.yaml?&tag=version-1.0.0-rc.20&label=docker-1.0.0-rc.20&style=for-the-badge)
![Docker Build (latest-tag)](https://img.shields.io/github/actions/workflow/status/bondy-io/bondy/docker_image_build.yaml?&tag=version-1.0.0-rc.21&label=docker-1.0.0-rc.21&style=for-the-badge)
<br>![Architectures](https://img.shields.io/badge/architecture-linux%2Famd64%20%7C%20linux%2Farm64%20%7C%20macOS%2Fintel%20%7C%20macOS%2FM1-lightgrey?style=for-the-badge)


Expand Down Expand Up @@ -158,7 +158,7 @@ make release
Untar and copy the resulting tarball to the location where you want to install Bondy e.g. `~/tmp/bondy`.

```shell
tar -zxvf _build/prod/rel/bondy-1.0.0-rc.20.tar.qz -C ~/tmp/bondy
tar -zxvf _build/prod/rel/bondy-1.0.0-rc.21.tar.qz -C ~/tmp/bondy
```

#### Running
Expand Down
4 changes: 2 additions & 2 deletions apps/bondy/src/bondy.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"Bondy implements the open Web Application Messaging Protocol (WAMP) "
"and is written in Erlang."
},
{vsn, "1.0.0-rc.20"},
{vsn, "1.0.0-rc.21"},
{registered, []},
%% We pass the version number in the bondy_app:start/2 arguments
{mod, {bondy_app, [{vsn, "1.0.0-rc.20"}]}},
{mod, {bondy_app, [{vsn, "1.0.0-rc.21"}]}},
{applications,[
%% Erlang/OTP
stdlib,
Expand Down
14 changes: 7 additions & 7 deletions apps/bondy/src/bondy_dealer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ handle_call(Msg, ProcUri, Fun, Opts, Ctxt) when is_function(Fun, 2) ->
{ok, Entry} ->
do_call(CallId, ProcUri, Fun, Opts, Ctxt, Entry);

{error, no_proc} ->
{error, noproc} ->
%% The matches were all dead (local process dead or remote target
%% unreachable)
Error = case format_error(no_such_procedure, Opts) of
Expand Down Expand Up @@ -1634,10 +1634,10 @@ do_call(CallId, ProcUri, UserFun, Opts, Ctxt0, Entry) ->
%% -----------------------------------------------------------------------------
-spec choose(
Entries :: {[entry()], trie_continuation() | eot()} | eot(),
CallOpts :: map()) -> {ok, Entry :: entry()} | {error, no_proc}.
CallOpts :: map()) -> {ok, Entry :: entry()} | {error, noproc}.

choose(?EOT, _) ->
{error, no_proc};
{error, noproc};

choose({L, Cont}, CallOpts) ->
choose(L, CallOpts, undefined, [], Cont).
Expand All @@ -1653,10 +1653,10 @@ choose({L, Cont}, CallOpts) ->
Group :: {Uri :: uri(), Match :: binary(), Invoke :: binary()} | undefined,
Acc :: [entry()],
Cont :: trie_continuation()) ->
{ok, Entry :: entry()} | {error, no_proc | any()}.
{ok, Entry :: entry()} | {error, noproc | any()}.

choose([], _, _, [], ?EOT) ->
{error, no_proc};
{error, noproc};

choose([], CallOpts, _, [], Cont) ->
choose(bondy_registry:match(Cont), CallOpts);
Expand All @@ -1668,7 +1668,7 @@ choose([], CallOpts, {_, _, Invoke}, Acc, Cont) ->
case bondy_rpc_load_balancer:select(L, LBOpts) of
{ok, _} = OK ->
OK;
{error, no_proc} ->
{error, noproc} ->
choose(bondy_registry:match(Cont), CallOpts);
Error ->
Error
Expand All @@ -1694,7 +1694,7 @@ choose([H|T], CallOpts, LastGroup, Acc, Cont) ->
case bondy_rpc_load_balancer:select(L, LBOpts) of
{ok, _} = OK ->
OK;
{error, no_proc} ->
{error, noproc} ->
%% We continue w/next group, we reset Acc
choose(T, CallOpts, Group, [H], Cont);
Error ->
Expand Down
9 changes: 9 additions & 0 deletions apps/bondy/src/bondy_http_gateway_rest_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ wamp_context(RealmUri, Peer, St1) ->
peer => Peer,
is_anonymous => IsAnonymous,
authid => Authid,
authroles => authroles(St1),
roles => #{
caller => #{
features => #{
Expand All @@ -950,6 +951,14 @@ authid(St) ->
maps:get(authid, St).


%% @private
authroles(#{api_context := #{<<"security">> := #{<<"groups">> := Groups}}}) ->
Groups;

authroles(_) ->
[].


%% @private
from_http_response(StatusCode, RespHeaders, RespBody, Spec, St0)
when StatusCode >= 400 andalso StatusCode < 600 ->
Expand Down
6 changes: 6 additions & 0 deletions apps/bondy/src/bondy_oauth2.erl
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ revoke_token(refresh_token, RealmUri, Issuer, Token) ->
revoke_refresh_token(RealmUri, Issuer, Token);

revoke_token(access_token, _, _, _) ->
{error, unsupported_operation};

revoke_token(undefined, _, _, _) ->
{error, unsupported_operation}.


Expand All @@ -285,6 +288,9 @@ revoke_token(refresh_token, RealmUri, Issuer, Username, DeviceId) ->
revoke_refresh_token(RealmUri, Issuer, Username, DeviceId);

revoke_token(access_token, _, _, _, _) ->
{error, unsupported_operation};

revoke_token(undefined, _, _, _, _) ->
{error, unsupported_operation}.


Expand Down
5 changes: 5 additions & 0 deletions apps/bondy/src/bondy_rbac_user.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ do_update(RealmUri, User, Data, Opts) when is_map(User) ->


%% @private
%% User can't be a TOMBSTONE because is checked before calling this function
have_credentials_changed(User, Data) when is_list(User) ->
%% Support for legacy formar
have_credentials_changed(value_from_term(User), Data);
Expand All @@ -1322,6 +1323,10 @@ have_credentials_changed(User, Data) when is_list(Data) ->
%% Support for legacy formar
have_credentials_changed(User, value_from_term(Data));

have_credentials_changed(_, ?TOMBSTONE) ->
%% Credentials were deleted
true;

have_credentials_changed(User, Data) ->
has_password_changed(User, Data)
orelse have_authorized_keys_changed(User, Data).
Expand Down
2 changes: 1 addition & 1 deletion apps/bondy_broker_bridge/src/bondy_broker_bridge.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{description,
"Bondy Broker Bridge is an application that is part of Bondy and provides a way to integrate Events with external brokers and systems."
},
{vsn, "1.0.0-rc.20"},
{vsn, "1.0.0-rc.21"},
{registered, []},
{mod, {bondy_broker_bridge_app, []}},
{applications, [
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@


{relx, [
{release, {bondy, "1.0.0-rc.20"},[
{release, {bondy, "1.0.0-rc.21"},[
%% Erlang/OTP
crypto,
inets,
Expand Down

0 comments on commit 3db37ac

Please sign in to comment.