-
Notifications
You must be signed in to change notification settings - Fork 5
Implements basic claims request parameter (Closes #11) #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| AllCops: | ||
| NewCops: enable | ||
| TargetRubyVersion: 3.0 | ||
|
|
||
| Naming/RescuedExceptionsVariableName: | ||
| Enabled: Yes | ||
| PreferredName: error | ||
|
|
||
| Style/Documentation: | ||
| Enabled: No |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,18 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module OIDCProvider | ||
| class UserInfosController < ApplicationController | ||
| before_action :require_access_token | ||
|
|
||
| def show | ||
| render json: AccountToUserInfo.new.(current_token.authorization.account, current_token.authorization.scopes) | ||
| render json: user_info | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def user_info | ||
| AccountToUserInfo.new(current_token.authorization.user_info_scopes) | ||
| .call(current_token.authorization.account) | ||
| end | ||
| end | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,14 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| class CreateOIDCProviderAuthorizations < ActiveRecord::Migration[5.1] | ||
| def change | ||
| create_table :oidc_provider_authorizations do |t| | ||
| t.references :account, foreign_key: {to_table: OIDCProvider.account_class.tableize}, null: false | ||
| t.references :account, foreign_key: { to_table: OIDCProvider.account_class.tableize }, null: false | ||
| t.string :client_id, null: false | ||
| t.string :nonce | ||
| t.string :code, null: false | ||
| t.text :scopes, null: false | ||
| t.text :claims | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to happen in a new migration, which it does. So we should remove it here
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Completely agreed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, sorry, checking my code again and I see that here it will apply for new projects, while the new migration script We could keep it like this, but if you really want it I can remove it. |
||
| t.datetime :expires_at, null: false | ||
|
|
||
| t.timestamps | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.