Unverified Commit eb7cb068 authored by Dan Jones's avatar Dan Jones
Browse files

docs: add comments and examples

+ use response from implicit auth in get auth header
parent dc9e90b9
......@@ -92,6 +92,10 @@ The topics have the following structure:
```
project.operator.vehicleType.vehicleID.[send|receive].messageType
# eg
soar.noc.autosub.ah1.send.platform-mission
# or
soar.po.ecosub.eco1.receive.platform-status
```
Subscriptions may contain single-word wildcards (*) or multi-word wildcards (#).
......
......@@ -47,7 +47,7 @@ class Adapter {
if (!this.tokenValid())
return this.auth().then((response) => {
return {
Authorization: `Bearer ${this.credentials.token}`,
Authorization: `Bearer ${response.data.token}`,
};
});
else {
......
......@@ -49,7 +49,7 @@ class Adapter {
if (!this.tokenValid())
return this.auth().then((response) => {
return {
Authorization: `Bearer ${this.credentials.token}`,
Authorization: `Bearer ${response.data.token}`,
};
});
else {
......
......@@ -59,6 +59,9 @@ class GenericProtocol {
/**
* Invoked on receiving a message from the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the decode method
* @param {string} type
* @param {object} message
* @returns {*}
......@@ -69,6 +72,9 @@ class GenericProtocol {
/**
* Optionally invoked before delivering a message to the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the encode method
* @param {string} type
* @param {*} message
* @returns {object}
......
......@@ -61,6 +61,9 @@ class GenericProtocol {
/**
* Invoked on receiving a message from the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the decode method
* @param {string} type
* @param {object} message
* @returns {*}
......@@ -71,6 +74,9 @@ class GenericProtocol {
/**
* Optionally invoked before delivering a message to the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the encode method
* @param {string} type
* @param {*} message
* @returns {object}
......
......@@ -47,7 +47,7 @@ export class Adapter {
if (!this.tokenValid())
return this.auth().then((response) => {
return {
Authorization: `Bearer ${this.credentials.token}`,
Authorization: `Bearer ${response.data.token}`,
};
});
else {
......
......@@ -59,6 +59,9 @@ export class GenericProtocol {
/**
* Invoked on receiving a message from the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the decode method
* @param {string} type
* @param {object} message
* @returns {*}
......@@ -69,6 +72,9 @@ export class GenericProtocol {
/**
* Optionally invoked before delivering a message to the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the encode method
* @param {string} type
* @param {*} message
* @returns {object}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment