Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Communications Backbone System
backbone-adapter-javascript
Commits
96b817b1
Commit
96b817b1
authored
2 weeks ago
by
Trishna Saeharaseelan
Browse files
Options
Download
Plain Diff
Merge branch 'release-v1.0.0' into 'master'
Release v1.0.0 See merge request
!21
parents
6f12efac
ddd579ef
dev
master
v1.0.0
1 merge request
!21
Release v1.0.0
Pipeline
#267356
passed with stages
in 2 minutes and 8 seconds
Changes
8
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
5 deletions
+43
-5
CHANGELOG.md
CHANGELOG.md
+12
-1
dist/adapter.esm.js
dist/adapter.esm.js
+9
-0
dist/adapter.js
dist/adapter.js
+9
-0
dist/protocol.esm.js
dist/protocol.esm.js
+1
-1
dist/protocol.js
dist/protocol.js
+1
-1
package.json
package.json
+1
-1
src/adapter/index.js
src/adapter/index.js
+9
-0
src/protocol/index.js
src/protocol/index.js
+1
-1
No files found.
CHANGELOG.md
View file @
96b817b1
...
...
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
## [v1.0.0] - 2025-03-11
### Fixed
-
Wait for authentication to complete for fast polling rates
### Changed
-
Add hyphen to regex for schema version to enable issue branches
## [v0.1.0] - 2023-03-24
### Added
...
...
@@ -26,5 +36,6 @@ Create a soar protocol instance
-
implement retreive schema version by tag/branch/commitref
-
override methods to handle soar message structure
[
unreleased
]:
https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-javascript/compare/v1.0.0...dev
[
v1.0.0
]:
https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-javascript/compare/v0.1.0...v1.0.0
[
v0.1.0
]:
https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-javascript/compare/a8eef21a...v0.1.0
[
unreleased
]:
https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-javascript/compare/v0.1.0...dev
This diff is collapsed.
Click to expand it.
dist/adapter.esm.js
View file @
96b817b1
...
...
@@ -8,6 +8,7 @@ class Adapter {
this
.
protocol
=
protocol
;
this
.
config
=
config
;
this
.
axios
=
axios
;
this
.
authenticating
=
false
;
}
/**
...
...
@@ -44,6 +45,10 @@ class Adapter {
* @returns {object}
*/
getAuthorizationHeader
()
{
if
(
this
.
authenticating
)
{
// return an pseudo response with an ignored status
return
Promise
.
reject
({
response
:
{
status
:
405
}
});
}
if
(
!
this
.
tokenValid
())
return
this
.
auth
().
then
((
response
)
=>
{
return
{
...
...
@@ -62,6 +67,7 @@ class Adapter {
* @returns {object}
*/
auth
()
{
this
.
authenticating
=
true
;
let
adapterConfig
=
this
.
config
;
return
this
.
axios
.
get
(
`
${
adapterConfig
.
api
}
/token`
,
{
...
...
@@ -72,9 +78,11 @@ class Adapter {
})
.
then
((
response
)
=>
{
this
.
credentials
=
response
.
data
;
this
.
authenticating
=
false
;
return
response
;
})
.
catch
((
error
)
=>
{
this
.
authenticating
=
false
;
return
Promise
.
reject
(
error
);
});
}
...
...
@@ -116,6 +124,7 @@ class Adapter {
retry
=
true
;
}
break
;
// ignore 405 from auth in progress
case
503
:
{
retry
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
dist/adapter.js
View file @
96b817b1
...
...
@@ -10,6 +10,7 @@ class Adapter {
this
.
protocol
=
protocol
;
this
.
config
=
config
;
this
.
axios
=
axios
;
this
.
authenticating
=
false
;
}
/**
...
...
@@ -46,6 +47,10 @@ class Adapter {
* @returns {object}
*/
getAuthorizationHeader
()
{
if
(
this
.
authenticating
)
{
// return an pseudo response with an ignored status
return
Promise
.
reject
({
response
:
{
status
:
405
}
});
}
if
(
!
this
.
tokenValid
())
return
this
.
auth
().
then
((
response
)
=>
{
return
{
...
...
@@ -64,6 +69,7 @@ class Adapter {
* @returns {object}
*/
auth
()
{
this
.
authenticating
=
true
;
let
adapterConfig
=
this
.
config
;
return
this
.
axios
.
get
(
`
${
adapterConfig
.
api
}
/token`
,
{
...
...
@@ -74,9 +80,11 @@ class Adapter {
})
.
then
((
response
)
=>
{
this
.
credentials
=
response
.
data
;
this
.
authenticating
=
false
;
return
response
;
})
.
catch
((
error
)
=>
{
this
.
authenticating
=
false
;
return
Promise
.
reject
(
error
);
});
}
...
...
@@ -118,6 +126,7 @@ class Adapter {
retry
=
true
;
}
break
;
// ignore 405 from auth in progress
case
503
:
{
retry
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
dist/protocol.esm.js
View file @
96b817b1
...
...
@@ -125,7 +125,7 @@ class GenericSoarProtocol extends GenericProtocol {
* @returns {object}
*/
createValidator
(
schema
)
{
if
(
typeof
schema
===
'
string
'
&&
schema
.
match
(
/^
[\w
.
]
+$/
))
{
if
(
typeof
schema
===
'
string
'
&&
schema
.
match
(
/^
[\w
.
-
]
+$/
))
{
this
.
loadSchema
(
schema
).
then
((
schema
)
=>
{
this
.
validator
=
new
Validator
(
schema
);
});
...
...
This diff is collapsed.
Click to expand it.
dist/protocol.js
View file @
96b817b1
...
...
@@ -127,7 +127,7 @@ class GenericSoarProtocol extends GenericProtocol {
* @returns {object}
*/
createValidator
(
schema
)
{
if
(
typeof
schema
===
'
string
'
&&
schema
.
match
(
/^
[\w
.
]
+$/
))
{
if
(
typeof
schema
===
'
string
'
&&
schema
.
match
(
/^
[\w
.
-
]
+$/
))
{
this
.
loadSchema
(
schema
).
then
((
schema
)
=>
{
this
.
validator
=
new
Validator
(
schema
);
});
...
...
This diff is collapsed.
Click to expand it.
package.json
View file @
96b817b1
{
"name"
:
"@noc-comms-backbone/backbone-adapter-javascript"
,
"version"
:
"
0.1
.0"
,
"version"
:
"
1.0
.0"
,
"private"
:
true
,
"contributors"
:
[
{
...
...
This diff is collapsed.
Click to expand it.
src/adapter/index.js
View file @
96b817b1
...
...
@@ -8,6 +8,7 @@ export class Adapter {
this
.
protocol
=
protocol
;
this
.
config
=
config
;
this
.
axios
=
axios
;
this
.
authenticating
=
false
;
}
/**
...
...
@@ -44,6 +45,10 @@ export class Adapter {
* @returns {object}
*/
getAuthorizationHeader
()
{
if
(
this
.
authenticating
)
{
// return an pseudo response with an ignored status
return
Promise
.
reject
({
response
:
{
status
:
405
}
});
}
if
(
!
this
.
tokenValid
())
return
this
.
auth
().
then
((
response
)
=>
{
return
{
...
...
@@ -62,6 +67,7 @@ export class Adapter {
* @returns {object}
*/
auth
()
{
this
.
authenticating
=
true
;
let
adapterConfig
=
this
.
config
;
return
this
.
axios
.
get
(
`
${
adapterConfig
.
api
}
/token`
,
{
...
...
@@ -72,9 +78,11 @@ export class Adapter {
})
.
then
((
response
)
=>
{
this
.
credentials
=
response
.
data
;
this
.
authenticating
=
false
;
return
response
;
})
.
catch
((
error
)
=>
{
this
.
authenticating
=
false
;
return
Promise
.
reject
(
error
);
});
}
...
...
@@ -116,6 +124,7 @@ export class Adapter {
retry
=
true
;
}
break
;
// ignore 405 from auth in progress
case
503
:
{
retry
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
src/protocol/index.js
View file @
96b817b1
...
...
@@ -125,7 +125,7 @@ export class GenericSoarProtocol extends GenericProtocol {
* @returns {object}
*/
createValidator
(
schema
)
{
if
(
typeof
schema
===
'
string
'
&&
schema
.
match
(
/^
[\w
.
]
+$/
))
{
if
(
typeof
schema
===
'
string
'
&&
schema
.
match
(
/^
[\w
.
-
]
+$/
))
{
this
.
loadSchema
(
schema
).
then
((
schema
)
=>
{
this
.
validator
=
new
Validator
(
schema
);
});
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment