Skip to content

Commit

Permalink
HELP-42761: allow username to be changed when using SSO only (2600hz#…
Browse files Browse the repository at this point in the history
…5572)

* HELP-42761: allow username to be changed when using SSO only

* HELP-42761: formatting
  • Loading branch information
k-anderson authored Mar 13, 2019
1 parent fa69d98 commit 4f7fd7c
Show file tree
Hide file tree
Showing 8 changed files with 394 additions and 181 deletions.
21 changes: 21 additions & 0 deletions applications/crossbar/priv/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -30021,6 +30021,27 @@
},
"type": "object"
},
"system_config.crossbar.users": {
"description": "Schema for crossbar.users system_config",
"properties": {
"generate_password_if_empty": {
"default": false,
"description": "crossbar users generate_password_if_empty",
"type": "boolean"
},
"generate_username_if_empty": {
"default": true,
"description": "crossbar users generate_username_if_empty",
"type": "boolean"
},
"reset_identity_secret_on_rehash": {
"default": true,
"description": "crossbar users reset_identity_secret_on_rehash",
"type": "boolean"
}
},
"type": "object"
},
"system_config.crossbar.voicemail": {
"description": "Schema for crossbar.voicemail system_config",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"_id": "system_config.crossbar.users",
"description": "Schema for crossbar.users system_config",
"properties": {
"generate_password_if_empty": {
"default": false,
"description": "crossbar users generate_password_if_empty",
"type": "boolean"
},
"generate_username_if_empty": {
"default": true,
"description": "crossbar users generate_username_if_empty",
"type": "boolean"
},
"reset_identity_secret_on_rehash": {
"default": true,
"description": "crossbar users reset_identity_secret_on_rehash",
"type": "boolean"
}
},
"type": "object"
}
9 changes: 9 additions & 0 deletions applications/crossbar/src/crossbar_auth.erl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
,validate_auth_token/1, validate_auth_token/2
,authorize_auth_token/1
,reset_identity_secret/1
,has_identity_secret/1
,log_success_auth/4, log_success_auth/5, log_success_auth/6
,log_failed_auth/4, log_failed_auth/5, log_failed_auth/6
,get_inherited_config/1
Expand Down Expand Up @@ -184,6 +185,14 @@ reset_identity_secret(Context) ->
Doc = kz_auth_identity:reset_doc_secret(cb_context:doc(Context)),
cb_context:set_doc(Context, Doc).

%%------------------------------------------------------------------------------
%% @doc Check if user has a non-empty `pvt_signature_secret'
%% @end
%%------------------------------------------------------------------------------
-spec has_identity_secret(cb_context:context()) -> boolean().
has_identity_secret(Context) ->
kz_auth_identity:has_doc_secret(cb_context:doc(Context)).

%%------------------------------------------------------------------------------
%% @doc Get merge result of account and its parents, reseller and system
%% authentication configuration.
Expand Down
Loading

0 comments on commit 4f7fd7c

Please sign in to comment.