[#44841] rework of api endpoints
- added representer for oauth client credentials and oauth applicationspull/11714/head
parent
3590831310
commit
2cf64065a8
@ -1,3 +0,0 @@ |
||||
class OAuthCredentialsRepresenter |
||||
|
||||
end |
@ -0,0 +1,53 @@ |
||||
# Schema: OAuthApplicationReadModel |
||||
--- |
||||
type: object |
||||
required: |
||||
- id |
||||
- _type |
||||
- clientId |
||||
- confidential |
||||
properties: |
||||
id: |
||||
type: integer |
||||
minimum: 1 |
||||
_type: |
||||
type: string |
||||
enum: |
||||
- OauthClientCredentials |
||||
clientId: |
||||
type: string |
||||
description: OAuth 2 client id |
||||
clientSecret: |
||||
type: string |
||||
description: OAuth 2 client secret |
||||
confidential: |
||||
type: boolean |
||||
description: true, if OAuth 2 credentials are confidential, false, if no secret is stored |
||||
createdAt: |
||||
type: string |
||||
format: date-time |
||||
description: The time the OAuth 2 Application was created at |
||||
updatedAt: |
||||
type: string |
||||
format: date-time |
||||
description: The time the OAuth 2 Application was last updated |
||||
scopes: |
||||
type: array |
||||
description: An array of the scopes of the OAuth 2 Application |
||||
items: |
||||
type: string |
||||
_links: |
||||
type: object |
||||
required: |
||||
- owner |
||||
- redirectUri |
||||
properties: |
||||
owner: |
||||
integration: |
||||
redirectUri: |
||||
|
||||
example: |
||||
id: 1337 |
||||
_type: OauthClientCredentials |
||||
clientId: O5h6WObhMg1Z8IcLHRE3_LMh4jJYmmca2V6OTFSv8DA |
||||
confidential: true |
@ -1,4 +1,4 @@ |
||||
# Schema: OauthCredentialsWriteModel |
||||
# Schema: OAuthClientCredentialsWriteModel |
||||
--- |
||||
type: object |
||||
required: |
@ -1,43 +0,0 @@ |
||||
#-- copyright |
||||
# OpenProject is an open source project management software. |
||||
# Copyright (C) 2012-2022 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. |
||||
#++ |
||||
|
||||
module API::V3::Storages |
||||
class OAuthCredentialsRepresenter < ::API::Decorators::Single |
||||
property :uid, as: :clientId |
||||
|
||||
property :plaintext_secret, as: :clientSecret |
||||
|
||||
def _type |
||||
'OauthCredentials' |
||||
end |
||||
|
||||
link :self do |
||||
{ href: "#{::API::V3::URN_PREFIX}storages:oauth_credentials:no_link_provided" } |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue