Skip to content

Commit

Permalink
Obscure features are obscure (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
bellebaum authored Feb 11, 2022
1 parent 49f3996 commit a1164bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def self.id_token(client, user, scopes, claims, nonce)
'exp' => now + base_config.dig('id_token', 'expiration'),
'auth_time' => user.auth_time,
'nonce' => nonce
}.compact!
}.compact
PluginLoader.load_plugins('claim_mapper').each do |mapper|
token.merge!(mapper.map_to_id_token(client, user, scopes, claims['id_token']))
end
Expand Down
7 changes: 5 additions & 2 deletions plugins/api/user_selfservice_v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
user_may_read = !(scopes & ['omejdn:admin', 'omejdn:write', 'omejdn:read']).empty?
halt 403 unless request.env['REQUEST_METHOD'] == 'GET' ? user_may_read : user_may_write
@user = User.find_by_id token['sub']
@selfservice_config = Config.base_config.dig('plugins', 'api', 'user_selfservice_v1')
@selfservice_config = Config.base_config.dig('plugins', 'api', 'user_selfservice_v1') || {
'editable_attributes' => [],
'allow_deletion' => false,
'allow_password_change' => false
}
halt 401 if @user.nil?
halt 403 if @selfservice_config.nil?
rescue StandardError => e
p e if debug
halt 401
Expand Down

0 comments on commit a1164bc

Please sign in to comment.