Skip to content

Commit

Permalink
Fix: examples to update auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvikns committed Nov 24, 2023
1 parent 22acee1 commit fa940ec
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 29 deletions.
40 changes: 24 additions & 16 deletions examples/crypto-websockets/client/asyncapi.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
asyncapi: 2.4.0
info:
asyncapi: 3.0.0
info:
title: asyncapicoin client
version: 1.0.0
description: |
This app creates a client that subscribes to the server for the price change.
description: >
This app creates a client that subscribes to the server for the price
change.
servers:
websockets:
url: ws://localhost:3000
host: 'localhost:3000'
protocol: ws
security:
- token: []
- userPass: []
- apiKey: []
- cert: []
x-remoteServers:
- websockets
- $ref: '#/components/securitySchemes/token'
- $ref: '#/components/securitySchemes/userPass'
- $ref: '#/components/securitySchemes/apiKey'
- $ref: '#/components/securitySchemes/cert'
channels:
/price:
address: /price
messages:
index.message:
$ref: '#/components/messages/indexGraph'
bindings:
ws:
bindingVersion: 0.1.0
publish:
operationId: index
message:
$ref: '#/components/messages/indexGraph'
operations:
index:
action: receive
channel:
$ref: '#/channels/~1price'
messages:
- $ref: '#/components/messages/indexGraph'
components:
messages:
indexGraph:
Expand All @@ -49,4 +55,6 @@ components:
in: header
cert:
type: apiKey
in: user
in: user
x-remoteServers:
- websockets
1 change: 1 addition & 0 deletions examples/crypto-websockets/server/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TOKEN=arb-tokenValue
35 changes: 22 additions & 13 deletions examples/crypto-websockets/server/asyncapi.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
asyncapi: 2.4.0
asyncapi: 3.0.0
info:
title: asyncapicoin server
version: 1.0.0
description: |
This app is a dummy server that would stream the price of a fake cryptocurrency
description: >
This app is a dummy server that would stream the price of a fake
cryptocurrency
servers:
websocket:
url: ws://localhost:3000
host: 'localhost:3000'
protocol: ws
security:
- token: []
- userPass: []
- apiKey: []
- cert: []
- $ref: '#/components/securitySchemes/token'
- $ref: '#/components/securitySchemes/userPass'
- $ref: '#/components/securitySchemes/apiKey'
- $ref: '#/components/securitySchemes/cert'
ws-websocket:
url: ws://localhost:4000
host: 'localhost:4000'
protocol: ws
channels:
/price:
address: /price
messages:
subscribe.message:
$ref: '#/components/messages/indexGraph'
bindings:
ws:
bindingVersion: 0.1.0
Expand All @@ -26,9 +31,13 @@ channels:
properties:
token:
type: string
subscribe:
message:
$ref: '#/components/messages/indexGraph'
operations:
/price.subscribe:
action: send
channel:
$ref: '#/channels/~1price'
messages:
- $ref: '#/components/messages/indexGraph'
components:
messages:
indexGraph:
Expand All @@ -55,4 +64,4 @@ components:
in: header
cert:
type: apiKey
in: user
in: user
Empty file.

0 comments on commit fa940ec

Please sign in to comment.