mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Merge pull request #23450 from opf/instance-id
Expose installation uuid via well-known endpoint
This commit is contained in:
@@ -0,0 +1,41 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
#-- copyright
|
||||||
|
# OpenProject is an open source project management software.
|
||||||
|
# Copyright (C) the OpenProject GmbH
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License version 3.
|
||||||
|
#
|
||||||
|
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||||
|
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||||
|
# Copyright (C) 2010-2013 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# See COPYRIGHT and LICENSE files for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
|
class OpenprojectMetadataController < ApplicationController
|
||||||
|
no_authorization_required! :show
|
||||||
|
|
||||||
|
skip_before_action :check_if_login_required
|
||||||
|
|
||||||
|
def show
|
||||||
|
render json: {
|
||||||
|
installation_uuid: Setting.installation_uuid
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
+6
-2
@@ -75,8 +75,12 @@ Rails.application.routes.draw do
|
|||||||
get "/auth/:provider", to: proc { [404, {}, [""]] }, as: "omni_auth_start"
|
get "/auth/:provider", to: proc { [404, {}, [""]] }, as: "omni_auth_start"
|
||||||
match "/auth/:provider/callback", to: "omni_auth_login#callback", as: "omni_auth_callback", via: %i[get post]
|
match "/auth/:provider/callback", to: "omni_auth_login#callback", as: "omni_auth_callback", via: %i[get post]
|
||||||
|
|
||||||
get "/.well-known/oauth-authorization-server", to: "oauth_metadata#authorization_server", as: :authorization_server_metadata
|
scope ".well-known" do
|
||||||
get "/.well-known/oauth-protected-resource", to: "oauth_metadata#protected_resource", as: :protected_resource_metadata
|
get "oauth-authorization-server", to: "oauth_metadata#authorization_server", as: :authorization_server_metadata
|
||||||
|
get "oauth-protected-resource", to: "oauth_metadata#protected_resource", as: :protected_resource_metadata
|
||||||
|
|
||||||
|
get "openproject-metadata", to: "openproject_metadata#show"
|
||||||
|
end
|
||||||
|
|
||||||
# In case assets are actually delivered by a node server (e.g. in test env)
|
# In case assets are actually delivered by a node server (e.g. in test env)
|
||||||
# forward requests to the proxy
|
# forward requests to the proxy
|
||||||
|
|||||||
+18
-1
@@ -12,6 +12,7 @@ OpenProject offers different APIs:
|
|||||||
* SCIM (System for Cross-domain Identity Management)
|
* SCIM (System for Cross-domain Identity Management)
|
||||||
* MCP (Model Context Protocol)
|
* MCP (Model Context Protocol)
|
||||||
* BCF API v2.1 api targeted towards BIM use cases
|
* BCF API v2.1 api targeted towards BIM use cases
|
||||||
|
* .well-known endpoints
|
||||||
|
|
||||||
Please note that we intend to keep this specification as accurate and stable as possible, however work on APIs is still ongoing
|
Please note that we intend to keep this specification as accurate and stable as possible, however work on APIs is still ongoing
|
||||||
and not all resources and actions in OpenProject are yet accessible through the APIs.
|
and not all resources and actions in OpenProject are yet accessible through the APIs.
|
||||||
@@ -26,7 +27,7 @@ The API v3 is a general purpose API supporting multiple use cases.
|
|||||||
While by no means complete, a whole lot of different scenarios can be automatized which otherwise would have to be carried out by hand via the UI.
|
While by no means complete, a whole lot of different scenarios can be automatized which otherwise would have to be carried out by hand via the UI.
|
||||||
Examples for this include managing work packages, projects and users.
|
Examples for this include managing work packages, projects and users.
|
||||||
|
|
||||||
We strive to maintain backward compatibility with this API in our stable OpenProject releases whenever possible.
|
We strive to maintain backward compatibility with this API in our stable OpenProject releases whenever possible.
|
||||||
|
|
||||||
➔ [Go to OpenProject API](./introduction/)
|
➔ [Go to OpenProject API](./introduction/)
|
||||||
|
|
||||||
@@ -53,3 +54,19 @@ This API supports BCF management in the context of BIM projects.
|
|||||||
While this API supports way less use cases than the more generic *API v3* it is compatible with the generic specification of a BCF API as [defined by the standard](https://github.com/buildingSMART/BCF-API/blob/release_2_1/README.md). Clients implementing the specification can manage topics and viewpoints.
|
While this API supports way less use cases than the more generic *API v3* it is compatible with the generic specification of a BCF API as [defined by the standard](https://github.com/buildingSMART/BCF-API/blob/release_2_1/README.md). Clients implementing the specification can manage topics and viewpoints.
|
||||||
|
|
||||||
➔ [Go to BCF API](./bcf-rest-api/)
|
➔ [Go to BCF API](./bcf-rest-api/)
|
||||||
|
|
||||||
|
## .well-known endpoints
|
||||||
|
|
||||||
|
Each OpenProject installation exposes some endpoints under the `/.well-known/` path:
|
||||||
|
|
||||||
|
* `/.well-known/oauth-authorization-server`: [RFC 8414](https://datatracker.ietf.org/doc/html/rfc8414): OAuth 2.0 Authorization Server Metadata
|
||||||
|
* `/.well-known/oauth-protected-resource`: [RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728): OAuth 2.0 Protected Resource Metadata
|
||||||
|
* `/.well-known/openproject-metadata`: Exposing non-confidential metadata about the OpenProject installation
|
||||||
|
|
||||||
|
### OpenProject Metadata
|
||||||
|
|
||||||
|
The `/.well-known/openproject-metadata` endpoint exposes some non-confidential metadata about the OpenProject instance in JSON format. This endpoint is accessible without authentication.
|
||||||
|
|
||||||
|
The following keys are exposed:
|
||||||
|
|
||||||
|
* `installation_uuid`: A unique identifier that's different per installation of OpenProject
|
||||||
|
|||||||
Reference in New Issue
Block a user