Remove JSON root from client controller
Signed-off-by: theworldbright <kent@kentshikama.com>
This commit is contained in:
parent
308170f691
commit
dd337d4163
4 changed files with 6 additions and 6 deletions
|
|
@ -12,7 +12,7 @@ module Api
|
|||
def create
|
||||
registrar = OpenIDConnect::Client::Registrar.new(request.url, params)
|
||||
client = Api::OpenidConnect::OAuthApplication.register! registrar
|
||||
render json: client
|
||||
render json: client.as_json(root: false)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ o_auth_query_params = %i(
|
|||
|
||||
Given /^I send a post request from that client to the code flow authorization endpoint$/ do
|
||||
client_json = JSON.parse(last_response.body)
|
||||
@client_id = client_json['o_auth_application']['client_id']
|
||||
@client_secret = client_json['o_auth_application']['client_secret']
|
||||
@client_id = client_json["client_id"]
|
||||
@client_secret = client_json["client_secret"]
|
||||
visit new_api_openid_connect_authorization_path +
|
||||
"?client_id=#{@client_id}&#{o_auth_query_params}"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ o_auth_query_params = %i(
|
|||
Given /^I send a post request from that client to the implicit flow authorization endpoint$/ do
|
||||
client_json = JSON.parse(last_response.body)
|
||||
visit new_api_openid_connect_authorization_path +
|
||||
"?client_id=#{client_json['o_auth_application']['client_id']}&#{o_auth_query_params}"
|
||||
"?client_id=#{client_json["client_id"]}&#{o_auth_query_params}"
|
||||
end
|
||||
|
||||
Given /^I send a post request from that client to the implicit flow authorization endpoint using a invalid client id/ do
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ describe Api::OpenidConnect::ClientsController, type: :controller do
|
|||
policy_uri: "http://example.com/policy", tos_uri: "http://example.com/tos",
|
||||
sector_identifier_uri: "http://example.com/uris", subject_type: "pairwise"
|
||||
client_json = JSON.parse(response.body)
|
||||
expect(client_json["o_auth_application"]["client_id"].length).to eq(32)
|
||||
expect(client_json["o_auth_application"]["ppid"]).to eq(true)
|
||||
expect(client_json["client_id"].length).to eq(32)
|
||||
expect(client_json["ppid"]).to eq(true)
|
||||
end
|
||||
end
|
||||
context "when redirect uri is missing" do
|
||||
|
|
|
|||
Loading…
Reference in a new issue