Fix failing auth code test and styles
This commit is contained in:
parent
8c2af74447
commit
9439a16d98
6 changed files with 15 additions and 16 deletions
|
|
@ -6,8 +6,7 @@ module Api
|
|||
|
||||
validates :client_id, presence: true, uniqueness: true
|
||||
validates :client_secret, presence: true
|
||||
validates :client_name, presence: true
|
||||
validates_uniqueness_of :client_name, scope: :redirect_uris
|
||||
validates :client_name, presence: true, uniqueness: {scope: :redirect_uris}
|
||||
|
||||
%i(redirect_uris response_types grant_types contacts).each do |serializable|
|
||||
serialize serializable, JSON
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
%i.entypo-browser
|
||||
.application-authorizations
|
||||
- if app[:authorizations].count > 0
|
||||
%h4=t("api.openid_connect.authorizations.new.access", name: app[:name])
|
||||
%h4= t("api.openid_connect.authorizations.new.access", name: app[:name])
|
||||
%ul
|
||||
- app[:authorizations].each do |authorization|
|
||||
%li
|
||||
|
|
@ -13,4 +13,4 @@
|
|||
%p= t("api.openid_connect.scopes.#{authorization}.description")
|
||||
- else
|
||||
.well
|
||||
=t("api.openid_connect.authorizations.new.no_requirement", name: app[:name])
|
||||
= t("api.openid_connect.authorizations.new.no_requirement", name: app[:name])
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
%li.list-group-item.authorized-application
|
||||
= render "grants_list", app: app
|
||||
= form_for "application", url: "#{api_openid_connect_authorizations_path}/#{app[:id]}",
|
||||
html: { method: :delete, class: "form-horizontal"} do |f|
|
||||
html: {method: :delete, class: "form-horizontal"} do |f|
|
||||
.clearfix= f.submit t("api.openid_connect.user_applications.revoke_autorization"),
|
||||
class: "btn btn-danger pull-right app-revoke"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
%i.entypo-browser
|
||||
.application-authorizations
|
||||
- if app[:authorizations].count > 0
|
||||
%h4=t("api.openid_connect.user_applications.index.access", name: app[:name])
|
||||
%h4= t("api.openid_connect.user_applications.index.access", name: app[:name])
|
||||
%ul
|
||||
- app[:authorizations].each do |authorization|
|
||||
%li
|
||||
|
|
@ -13,4 +13,4 @@
|
|||
%p= t("api.openid_connect.scopes.#{authorization}.description")
|
||||
- else
|
||||
.well
|
||||
=t("api.openid_connect.user_applications.index.no_requirement",name: app[:name])
|
||||
= t("api.openid_connect.user_applications.index.no_requirement", name: app[:name])
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#settings_nav
|
||||
%h2= t('settings')
|
||||
%h2= t("settings")
|
||||
%nav
|
||||
%ul
|
||||
%li= link_to_unless_current t('profile'), edit_profile_path
|
||||
%li= link_to_unless_current t('account'), edit_user_path
|
||||
%li= link_to_unless_current t('privacy'), privacy_settings_path
|
||||
%li= link_to_unless_current t('_services'), services_path
|
||||
%li= link_to_unless_current t('_applications'), api_openid_connect_user_applications_path
|
||||
%li= link_to_unless_current t("profile"), edit_profile_path
|
||||
%li= link_to_unless_current t("account"), edit_user_path
|
||||
%li= link_to_unless_current t("privacy"), privacy_settings_path
|
||||
%li= link_to_unless_current t("_services"), services_path
|
||||
%li= link_to_unless_current t("_applications"), api_openid_connect_user_applications_path
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
O_AUTH_QUERY_PARAMS = {
|
||||
O_AUTH_QUERY_PARAMS_WITH_CODE = {
|
||||
redirect_uri: "http://localhost:3000",
|
||||
response_type: "code",
|
||||
scope: "openid read",
|
||||
|
|
@ -10,12 +10,12 @@ Given /^I send a post request from that client to the code flow authorization en
|
|||
client_json = JSON.parse(last_response.body)
|
||||
@client_id = client_json["client_id"]
|
||||
@client_secret = client_json["client_secret"]
|
||||
params = O_AUTH_QUERY_PARAMS.merge(client_id: @client_id)
|
||||
params = O_AUTH_QUERY_PARAMS_WITH_CODE.merge(client_id: @client_id)
|
||||
visit new_api_openid_connect_authorization_path(params)
|
||||
end
|
||||
|
||||
Given /^I send a post request from that client to the code flow authorization endpoint using a invalid client id/ do
|
||||
params = O_AUTH_QUERY_PARAMS.merge(client_id: "randomid")
|
||||
params = O_AUTH_QUERY_PARAMS_WITH_CODE.merge(client_id: "randomid")
|
||||
visit new_api_openid_connect_authorization_path(params)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue