[#67055] Do not use unspecified ServiceProviderConfig.AuthenticationSchemes.type

https://community.openproject.org/work_packages/67055
This commit is contained in:
Pavel Balashou
2025-08-29 16:58:08 +02:00
parent c48105d468
commit 5add4fbbe8
3 changed files with 9 additions and 34 deletions
+2 -4
View File
@@ -182,10 +182,8 @@ sysadmin_docs:
href: https://www.openproject.org/docs/system-admin-guide/authentication/saml/
scim:
href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/
scim_static_access_token_authentication_method:
href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/#a-static-access-token
scim_oauth2_client_credentials_authentication_method:
href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/#b-oauth-20-client-credentials
scim_authentication:
href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/#step-3-choose-an-authentication-method
scim_jwt_authetication_method:
href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/#c-jwt-from-identity-provider
text_formatting:
+2 -14
View File
@@ -30,23 +30,11 @@
module OpenProjectScimitar
AUTHENTICATION_SCHEMES = [
Scimitar::AuthenticationScheme.new(
type: "oauth2",
name: "OAuth2",
description: OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_static_access_token_authentication_method,
localize_url: false)
),
Scimitar::AuthenticationScheme.new(
type: "oauthbearertoken",
name: "OAuth Bearer Token",
description: OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_oauth2_client_credentials_authentication_method,
localize_url: false)
),
Scimitar::AuthenticationScheme.new(
type: "oidcjwt",
name: "OpenID Provider JWT",
description: OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_jwt_authetication_method,
localize_url: false)
description: "Bearer Token can be obtained in 3 different ways" \
"(#{OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_authentication, localize_url: false)})"
)
].freeze
end
@@ -47,15 +47,10 @@ RSpec.describe "SCIM API ServiceProviderConfig" do
get "/scim_v2/ServiceProviderConfig", {}, headers
response_body = JSON.parse(last_response.body)
expect(response_body).to include("authenticationSchemes" => [{ "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#a-static-access-token",
"name" => "OAuth2",
"type" => "oauth2" },
{ "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#b-oauth-20-client-credentials",
expect(response_body).to include("authenticationSchemes" => [{ "description" => "Bearer Token can be obtained in 3 different ways(https://www.openproject.org/docs/system-admin-guide/authentication/scim/#step-3-choose-an-authentication-method)",
"name" => "OAuth Bearer Token",
"type" => "oauthbearertoken" },
{ "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#c-jwt-from-identity-provider",
"name" => "OpenID Provider JWT",
"type" => "oidcjwt" }],
"type" => "oauthbearertoken" }],
"bulk" => { "supported" => false },
"changePassword" => { "supported" => false },
"etag" => { "supported" => false },
@@ -86,15 +81,9 @@ RSpec.describe "SCIM API ServiceProviderConfig" do
expect(last_response).to have_http_status(200)
response_body = JSON.parse(last_response.body)
expect(response_body.keys).to eq(["meta", "schemas", "authenticationSchemes"])
expect(response_body).to include("authenticationSchemes" => [{ "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#a-static-access-token",
"name" => "OAuth2",
"type" => "oauth2" },
{ "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#b-oauth-20-client-credentials",
expect(response_body).to include("authenticationSchemes" => [{ "description" => "Bearer Token can be obtained in 3 different ways(https://www.openproject.org/docs/system-admin-guide/authentication/scim/#step-3-choose-an-authentication-method)",
"name" => "OAuth Bearer Token",
"type" => "oauthbearertoken" },
{ "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#c-jwt-from-identity-provider",
"name" => "OpenID Provider JWT",
"type" => "oidcjwt" }],
"type" => "oauthbearertoken" }],
"schemas" => ["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"])
end
end