-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBG-4143 add redocly targets for capella #7044
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5f5fbd3
CBG-4143 add redocly targets for capella
torcolvin 10446c6
mark capella metrics port as 4988 and url as :4988/metrics
torcolvin 045ddbb
wip
torcolvin 456edbb
add public-capella target
torcolvin e649b1b
use built in info-override decorator
torcolvin 2ccb879
remove unused public-capella.yaml and use x-capella filtering on on a…
torcolvin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright 2022-Present Couchbase, Inc. | ||
# | ||
# Use of this software is governed by the Business Source License included | ||
# in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
# in that file, in accordance with the Business Source License, use of this | ||
# software will be governed by the Apache License, Version 2.0, included in | ||
# the file licenses/APL2.txt. | ||
|
||
openapi: 3.0.3 | ||
info: | ||
title: App Services Admin API | ||
description: 'App Services manages access and synchronization between Couchbase Lite and Couchbase Capella' | ||
version: 3.3.0 | ||
license: | ||
name: Business Source License 1.1 (BSL) | ||
url: 'https://github.com/couchbase/sync_gateway/blob/master/LICENSE' | ||
servers: | ||
- url: 'https://{hostname}:4985' | ||
description: Admin API | ||
variables: | ||
hostname: | ||
description: The hostname to use | ||
default: localhost | ||
paths: | ||
'/{db}/_session': | ||
$ref: './paths/admin/db-_session.yaml' | ||
'/{db}/_session/{sessionid}': | ||
$ref: './paths/admin/db-_session-sessionid.yaml' | ||
'/{db}/_user/{name}': | ||
$ref: './paths/admin/db-_user-name.yaml' | ||
'/{db}/_user/{name}/_session': | ||
$ref: './paths/admin/db-_user-name-_session.yaml' | ||
'/{db}/_user/{name}/_session/{sessionid}': | ||
$ref: './paths/admin/db-_user-name-_session-sessionid.yaml' | ||
'/{db}/_role/': | ||
$ref: './paths/admin/db-_role-.yaml' | ||
'/{db}/_role/{name}': | ||
$ref: './paths/admin/db-_role-name.yaml' | ||
|
||
externalDocs: | ||
description: Manage App Services for Mobile and Edge | Couchbase Docs | ||
url: 'https://docs.couchbase.com/cloud/app-services/index.html' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2022-Present Couchbase, Inc. | ||
# | ||
# Use of this software is governed by the Business Source License included | ||
# in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
# in that file, in accordance with the Business Source License, use of this | ||
# software will be governed by the Apache License, Version 2.0, included in | ||
# the file licenses/APL2.txt. | ||
|
||
openapi: 3.0.3 | ||
info: | ||
title: App Services Metrics API | ||
description: 'App Services manages access and synchronization between Couchbase Lite and Couchbase Capella' | ||
version: 3.3.0 | ||
license: | ||
name: Business Source License 1.1 (BSL) | ||
url: 'https://github.com/couchbase/sync_gateway/blob/master/LICENSE' | ||
servers: | ||
- url: 'https://{hostname}:4988' | ||
description: Metrics API | ||
variables: | ||
hostname: | ||
description: The hostname to use | ||
default: localhost | ||
paths: | ||
/metrics: | ||
$ref: ./paths/metric/metrics.yaml | ||
tags: | ||
- name: Prometheus | ||
description: Endpoints for use with Prometheus | ||
externalDocs: | ||
description: Manage App Services for Mobile and Edge | Couchbase Docs | ||
url: 'https://docs.couchbase.com/cloud/app-services/index.html' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright 2024-Present Couchbase, Inc. | ||
* | ||
* Use of this software is governed by the Business Source License included | ||
* in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
* in that file, in accordance with the Business Source License, use of this | ||
* software will be governed by the Apache License, Version 2.0, included in | ||
* the file licenses/APL2.txt. | ||
*/ | ||
|
||
/** | ||
* Removes the RBAC roles from capella API docs. This expects the RBAC information to be at the end of the documentation string. This is not a robust way of doing this. | ||
* @module ExciseRBACCapella | ||
*/ | ||
|
||
module.exports = ExciseRBACCapella; | ||
|
||
const re = new RegExp("Required Sync Gateway RBAC roles"); | ||
|
||
/** @type {import('@redocly/cli').OasDecorator} */ | ||
function ExciseRBACCapella() { | ||
return { | ||
Operation: { | ||
leave(Operation) { | ||
// remove all text after first regex match | ||
idx = Operation.description.search(re); | ||
if (idx > 0) { | ||
Operation.description = Operation.description.substr(0, idx); | ||
} | ||
}, | ||
}, | ||
}; | ||
} |
30 changes: 30 additions & 0 deletions
30
docs/api/plugins/decorators/replace-description-capella.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Copyright 2024-Present Couchbase, Inc. | ||
* | ||
* Use of this software is governed by the Business Source License included | ||
* in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
* in that file, in accordance with the Business Source License, use of this | ||
* software will be governed by the Apache License, Version 2.0, included in | ||
* the file licenses/APL2.txt. | ||
*/ | ||
|
||
/** | ||
* Does a string replacement on all operations (GET,PUT,POST,etc) to replace Sync Gateway with App Services. | ||
* @module ReplaceDescriptionCapella | ||
*/ | ||
|
||
module.exports = ReplaceDescriptionCapella; | ||
|
||
/** @type {import('@redocly/cli').OasDecorator} */ | ||
function ReplaceDescriptionCapella() { | ||
return { | ||
Operation: { | ||
leave(Operation) { | ||
Operation.description = Operation.description.replace( | ||
"Sync Gateway", | ||
"App Services", | ||
); | ||
}, | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright 2024-Present Couchbase, Inc. | ||
* | ||
* Use of this software is governed by the Business Source License included | ||
* in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
* in that file, in accordance with the Business Source License, use of this | ||
* software will be governed by the Apache License, Version 2.0, included in | ||
* the file licenses/APL2.txt. | ||
*/ | ||
|
||
module.exports = ReplaceServersCapella; | ||
|
||
/** @type {import('@redocly/cli').OasDecorator} */ | ||
function ReplaceServersCapella({ serverUrl }) { | ||
return { | ||
Server: { | ||
leave(Server) { | ||
if (serverUrl) { | ||
Server.url = serverUrl; | ||
} | ||
}, | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright 2024-Present Couchbase, Inc. | ||
* | ||
* Use of this software is governed by the Business Source License included | ||
* in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
* in that file, in accordance with the Business Source License, use of this | ||
* software will be governed by the Apache License, Version 2.0, included in | ||
* the file licenses/APL2.txt. | ||
*/ | ||
|
||
const ExciseRBACCapella = require("./decorators/excise-rbac-capella.js"); | ||
const ReplaceDescriptionCapella = require("./decorators/replace-description-capella.js"); | ||
const ReplaceServerCapella = require("./decorators/replace-server-capella.js"); | ||
|
||
module.exports = { | ||
decorators: { | ||
oas3: { | ||
"excise-rbac-capella": ExciseRBACCapella, | ||
"replace-description-capella": ReplaceDescriptionCapella, | ||
"replace-server-capella": ReplaceServerCapella, | ||
}, | ||
}, | ||
id: "plugin", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# Copyright 2022-Present Couchbase, Inc. | ||
# | ||
# Use of this software is governed by the Business Source License included | ||
# in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
# in that file, in accordance with the Business Source License, use of this | ||
# software will be governed by the Apache License, Version 2.0, included in | ||
# the file licenses/APL2.txt. | ||
|
||
openapi: 3.0.3 | ||
info: | ||
title: Sync Gateway | ||
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server | ||
version: 3.3.0 | ||
license: | ||
name: Business Source License 1.1 (BSL) | ||
url: 'https://github.com/couchbase/sync_gateway/blob/master/LICENSE' | ||
servers: | ||
- url: '{protocol}://{hostname}:4984' | ||
description: Public API | ||
variables: | ||
protocol: | ||
description: The protocol to use (HTTP or HTTPS) | ||
default: http | ||
enum: | ||
- http | ||
- https | ||
hostname: | ||
description: The hostname to use | ||
default: localhost | ||
paths: | ||
'/{db}/_session': | ||
$ref: './paths/public/db-_session.yaml' | ||
'/{targetdb}/': | ||
$ref: './paths/public/targetdb-.yaml' | ||
'/{db}/': | ||
$ref: './paths/public/db-.yaml' | ||
/: | ||
$ref: ./paths/public/-.yaml | ||
/_ping: | ||
$ref: ./paths/common/_ping.yaml | ||
'/{keyspace}/': | ||
$ref: './paths/admin/keyspace-.yaml' | ||
'/{keyspace}/_all_docs': | ||
$ref: './paths/public/keyspace-_all_docs.yaml' | ||
'/{keyspace}/_bulk_docs': | ||
$ref: './paths/public/keyspace-_bulk_docs.yaml' | ||
'/{keyspace}/_bulk_get': | ||
$ref: './paths/public/keyspace-_bulk_get.yaml' | ||
'/{keyspace}/_changes': | ||
$ref: './paths/public/keyspace-_changes.yaml' | ||
'/{db}/_design/{ddoc}': | ||
$ref: './paths/public/db-_design-ddoc.yaml' | ||
'/{db}/_design/{ddoc}/_view/{view}': | ||
$ref: './paths/public/db-_design-ddoc-_view-view.yaml' | ||
'/{db}/_ensure_full_commit': | ||
$ref: './paths/public/db-_ensure_full_commit.yaml' | ||
'/{keyspace}/_revs_diff': | ||
$ref: './paths/public/keyspace-_revs_diff.yaml' | ||
'/{keyspace}/_local/{docid}': | ||
$ref: './paths/public/keyspace-_local-docid.yaml' | ||
'/{keyspace}/{docid}': | ||
$ref: './paths/public/keyspace-docid.yaml' | ||
'/{keyspace}/{docid}/{attach}': | ||
$ref: './paths/public/keyspace-docid-attach.yaml' | ||
'/{db}/_facebook': | ||
$ref: './paths/public/db-_facebook.yaml' | ||
'/{db}/_google': | ||
$ref: './paths/public/db-_google.yaml' | ||
'/{db}/_oidc': | ||
$ref: './paths/public/db-_oidc.yaml' | ||
'/{db}/_oidc_challenge': | ||
$ref: './paths/public/db-_oidc_challenge.yaml' | ||
'/{db}/_oidc_callback': | ||
$ref: './paths/public/db-_oidc_callback.yaml' | ||
'/{db}/_oidc_refresh': | ||
$ref: './paths/public/db-_oidc_refresh.yaml' | ||
'/{db}/_oidc_testing/.well-known/openid-configuration': | ||
$ref: './paths/public/db-_oidc_testing-.well-known-openid-configuration.yaml' | ||
'/{db}/_oidc_testing/authorize': | ||
$ref: './paths/public/db-_oidc_testing-authorize.yaml' | ||
'/{db}/_oidc_testing/token': | ||
$ref: './paths/public/db-_oidc_testing-token.yaml' | ||
'/{db}/_oidc_testing/certs': | ||
$ref: './paths/public/db-_oidc_testing-certs.yaml' | ||
'/{db}/_oidc_testing/authenticate': | ||
$ref: './paths/public/db-_oidc_testing-authenticate.yaml' | ||
'/{db}/_blipsync': | ||
$ref: './paths/public/db-_blipsync.yaml' | ||
tags: | ||
- name: Server | ||
description: Manage server activities | ||
- name: Database Management | ||
description: Create and manage Sync Gateway databases | ||
- name: Session | ||
description: Manage user sessions | ||
- name: Authentication | ||
description: Manage OpenID Connect Authentication | ||
- name: Document | ||
description: Create and manage documents | ||
- name: Document Attachment | ||
description: Create and manage document attachments | ||
- name: Replication | ||
description: Create and manage inter-Sync Gateway replications | ||
- name: Unsupported | ||
description: Endpoints that are not supported by Sync Gateway | ||
externalDocs: | ||
description: Sync Gateway Quickstart | Couchbase Docs | ||
url: 'https://docs.couchbase.com/sync-gateway/current/index.html' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright 2024-Present Couchbase, Inc. | ||
* | ||
* Use of this software is governed by the Business Source License included | ||
* in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
* in that file, in accordance with the Business Source License, use of this | ||
* software will be governed by the Apache License, Version 2.0, included in | ||
* the file licenses/APL2.txt. | ||
*/ | ||
|
||
module.exports = ReplaceServersCapella; | ||
|
||
/** @type {import('@redocly/cli').OasDecorator} */ | ||
|
||
function ReplaceServersCapella({ serverUrl }) { | ||
return { | ||
Server: { | ||
leave(Server) { | ||
Server.url = serverUrl; | ||
delete Server.protocol; | ||
}, | ||
}, | ||
}; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be public-capella, or is the public-capella.yaml still in this PR now obsolete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that question is "Did the filter-out x-capella thing work, or is that a failed experiment?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public-capella.yaml is dead, thanks for catch.
For filter-out x-capella, it does work, it's in
public.yaml
to remove the views APIs. Usingfilter-out
the property has to be defined, so it can't just filter out everything that doesn't have the property defined. That's why admin and metric use different toplevel yaml files, since they have such limited APIs.I've added filter-out x-capella preemptively for admin and metric endpoints, since we could filter out parts of a particular operation. We aren't doing that yet but could in the future.