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_id, presence: true, uniqueness: true
|
||||||
validates :client_secret, presence: true
|
validates :client_secret, presence: true
|
||||||
validates :client_name, presence: true
|
validates :client_name, presence: true, uniqueness: {scope: :redirect_uris}
|
||||||
validates_uniqueness_of :client_name, scope: :redirect_uris
|
|
||||||
|
|
||||||
%i(redirect_uris response_types grant_types contacts).each do |serializable|
|
%i(redirect_uris response_types grant_types contacts).each do |serializable|
|
||||||
serialize serializable, JSON
|
serialize serializable, JSON
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#settings_nav
|
#settings_nav
|
||||||
%h2= t('settings')
|
%h2= t("settings")
|
||||||
%nav
|
%nav
|
||||||
%ul
|
%ul
|
||||||
%li= link_to_unless_current t('profile'), edit_profile_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("account"), edit_user_path
|
||||||
%li= link_to_unless_current t('privacy'), privacy_settings_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("_services"), services_path
|
||||||
%li= link_to_unless_current t('_applications'), api_openid_connect_user_applications_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",
|
redirect_uri: "http://localhost:3000",
|
||||||
response_type: "code",
|
response_type: "code",
|
||||||
scope: "openid read",
|
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_json = JSON.parse(last_response.body)
|
||||||
@client_id = client_json["client_id"]
|
@client_id = client_json["client_id"]
|
||||||
@client_secret = client_json["client_secret"]
|
@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)
|
visit new_api_openid_connect_authorization_path(params)
|
||||||
end
|
end
|
||||||
|
|
||||||
Given /^I send a post request from that client to the code flow authorization endpoint using a invalid client id/ do
|
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)
|
visit new_api_openid_connect_authorization_path(params)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue