Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/scripts/deploy-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ npm install -g bump-cli
# For each directory in the hubs/ directory
for hub in hubs/*/; do
for api in "${hub}"*-source.{yml,yaml,json}; do
[ -f "${api}" ] || continue
# Extract the Hub name from directory structure
hubName="${hub%/*}"
hubName="${hubName#*/}"
Expand All @@ -21,6 +22,15 @@ for hub in hubs/*/; do
apiName="${apiName#*/}"
apiName="${apiName#*/}"

# Apply any available overlays from filename
# `<api_name>-overlay*.yaml`
for overlay in "${hub}"/"${apiName}"-overlay*.{yml,yaml}; do
[ -f "${overlay}" ] || continue
# Overide current api definition file with overlayed
# definition
yes | npx bump-cli overlay "${api}" "${overlay}" -o "${api}"
done

# Create documentation <apiName> from the api definition file
tokenKey="${hubName//-/_}_BUMP_TOKEN"
tokenKey="${tokenKey^^}"
Expand Down
15 changes: 15 additions & 0 deletions hubs/my-train-company/docs/authentication/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#    

```
curl \
-X GET https://bump.sh/api/v1/versions/1 \
-H "Authorization: Token $ACCESS_TOKEN"
```

#    

```
curl \
-X GET https://bump.sh/api/v1/versions/1 \
-u ":$ACCESS_TOKEN"
```
11 changes: 11 additions & 0 deletions hubs/my-train-company/docs/authentication/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Http token authentication

> success
> This is the preferred authentication method for restricted access API endpoints

Use the token from your documentation settings in the HTTP token authorization header.

# Basic authentication

*(Deprecated)* Use the token from your documentation settings as the username of the basic auth, with no password.

5 changes: 0 additions & 5 deletions hubs/my-train-company/trainbook-openapi-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ security:
- OAuth2:
- read

x-topics:
- title: Getting started
content:
$ref: ./docs/getting-started.md

tags:
- name: Stations
description: |
Expand Down
16 changes: 16 additions & 0 deletions hubs/my-train-company/trainbook-overlay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
overlay: 1.0.0
info:
title: Add all the x-topics files as references
version: 0.0.1
actions:
- target: '$'
update:
x-topics:
- title: Getting started
content:
$ref: ./docs/getting-started.md
- title: Authentication
content:
$ref: ./docs/authentication/index.md
example:
$ref: ./docs/authentication/example.md