Skip to content

Commit

Permalink
Remove authentication from fd_openapi as this part is depending on th…
Browse files Browse the repository at this point in the history
…e use case

Add clarification to channel configuration post
  • Loading branch information
mfiebig committed Dec 11, 2024
1 parent 889ab4f commit 232bdd9
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 53 deletions.
6 changes: 3 additions & 3 deletions docs_sources/definitions/channels_get.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
examples:
response:
status: {
value: {
"channels": [
{
"id": "channel1"
"id": "channel1",
"status": "enabled"
},
{
Expand All @@ -29,5 +29,5 @@ schema:
type: string
enum: ["enabled", "disabled", "not_set"]
required:
- name
- id
- status
2 changes: 1 addition & 1 deletion docs_sources/definitions/channels_post.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
examples:
response:
update:
value: {
"channels": [
{
Expand Down
32 changes: 10 additions & 22 deletions docs_sources/fd_openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ paths:
}
tags:
- Setup
security:
- bearerAuth: []
/pushers/v1/set:
post:
summary: Modify a pusher for this user on the homeserver.
Expand Down Expand Up @@ -106,14 +104,14 @@ paths:
application/json:
schema:
$ref: definitions/rate_limited.yaml
security:
- bearerAuth: []
tags:
- Setup
/channels/v1/{pushtoken}:
get:
summary: Gets channels for a specific device.
description: Gets all channels and there configuration state of the users device identified by the `pushtoken`.
description: |-
Gets all channels and there configuration state of the users device identified by the
`pushtoken`.
operationId: getChannelsOfDevice
parameters:
- name: pushtoken
Expand Down Expand Up @@ -156,13 +154,14 @@ paths:
}
tags:
- Fachdienst
security:
- bearerAuth: []
post:
summary: Modify the channels for a specific device.
description: |-
This endpoint allows the creation, modification and deletion of channel subscriptions
for a specific device identified by `pushtoken`.
for a specific device identified by `pushtoken`. If a channel is not present in the POST
request, the state of the channel on the server is not changed.
An unset channel is treated as disabled and thus no pushes will be triggerd that correspond
to the channel.
operationId: postChannelsOfDevice
parameters:
- name: pushtoken
Expand All @@ -178,10 +177,8 @@ paths:
schema:
$ref: definitions/channels_post.yaml#/schema
examples:
registration:
$ref: definitions/channels_post.yaml#/examples/registration
deletion:
$ref: definitions/channels_post.yaml#/examples/deletion
update:
$ref: definitions/channels_post.yaml#/examples/update
description: The channel information.
required: true
responses:
Expand Down Expand Up @@ -215,8 +212,6 @@ paths:
$ref: definitions/rate_limited.yaml
tags:
- Fachdienst
security:
- bearerAuth: []
/channels/v1:
get:
summary: Gets the available channels for the authenticated user
Expand Down Expand Up @@ -255,8 +250,6 @@ paths:
}
tags:
- Fachdienst
security:
- bearerAuth: []
servers:
- url: "{protocol}://{hostname}{basePath}"
variables:
Expand All @@ -269,9 +262,4 @@ servers:
default: localhost:8008
basePath:
default: /client/v1
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security: []
38 changes: 19 additions & 19 deletions docs_sources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</head>
<body>
<div id="menu">
<a onclick="loadPage(this)" href="concept/concept.html" target="content">Concept</a>
<a onclick="loadPage(this)" href="concept/concept.html" target="content" class="active">Concept</a>
<a onclick="loadPage(this)" href="concept/optional-features.html" target="content">Optional Features</a>
<a onclick="loadPage(this)" href="concept/trigger_ePA.html" target="content">ePA</a>
<a onclick="loadPage(this)" href="fd_openapi.html" target="content">FD OpenAPI</a>
Expand Down Expand Up @@ -83,24 +83,8 @@
}
});
}
});

document.getElementById('content').addEventListener('load', function() {
let path = this.contentWindow.location.pathname + this.contentWindow.location.hash
// escape # from path
path = path.replace('#', '%23');
rootPath = window.location.pathname;
rootPath = rootPath.replace('index.html', '');
path = path.replace(rootPath, '');

if (window.location.hash.substring(1) != path) {
window.location.replace("#" + path);
}

this.contentWindow.addEventListener('hashchange', function() {
console.log("hashchange" + this.location.pathname + this.location.hash);

let path = this.location.pathname + this.location.hash
document.getElementById('content').addEventListener('load', function() {
let path = this.contentWindow.location.pathname + this.contentWindow.location.hash
// escape # from path
path = path.replace('#', '%23');
rootPath = window.location.pathname;
Expand All @@ -110,9 +94,25 @@
if (window.location.hash.substring(1) != path) {
window.location.replace("#" + path);
}

this.contentWindow.addEventListener('hashchange', function() {
console.log("hashchange" + this.location.pathname + this.location.hash);

let path = this.location.pathname + this.location.hash
// escape # from path
path = path.replace('#', '%23');
rootPath = window.location.pathname;
rootPath = rootPath.replace('index.html', '');
path = path.replace(rootPath, '');

if (window.location.hash.substring(1) != path) {
window.location.replace("#" + path);
}
});
});
});


window.addEventListener('hashchange', function() {
if (window.location.hash && window.location.hash.length > 1) {
var hash = window.location.hash.substring(1).replace('%23', '#');
Expand Down
2 changes: 1 addition & 1 deletion images/diagrams/channel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 232bdd9

Please sign in to comment.