Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Domain Data Management Services
Seismic
Seismic DMS Suite
seismic-dms-service
Commits
b61a97f3
Commit
b61a97f3
authored
Jun 29, 2021
by
Diego Molteni
Committed by
Sacha Brants
Jun 29, 2021
Browse files
fix: ensure the Auth header is present in a call to SDMS
parent
53e9ba5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server/server.ts
View file @
b61a97f3
...
...
@@ -19,7 +19,7 @@ import express from 'express';
import
jwtProxy
,
{
JwtProxyOptions
}
from
'
jwtproxy
'
;
import
{
Config
,
LoggerFactory
}
from
'
../cloud
'
;
import
{
ServiceRouter
}
from
'
../services
'
;
import
{
Feature
,
FeatureFlags
}
from
'
../shared
'
;
import
{
Error
,
Feature
,
FeatureFlags
,
Response
}
from
'
../shared
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
import
fs
from
'
fs
'
;
...
...
@@ -109,6 +109,16 @@ export class Server {
req
.
headers
.
authorization
=
req
.
get
(
'
slb-on-behalf-of
'
);
}
// ensure the authorization header is passed
if
(
!
req
.
headers
.
authorization
)
{
if
(
!
req
.
url
.
endsWith
(
'
svcstatus
'
))
{
Response
.
writeError
(
res
,
Error
.
make
(
Error
.
Status
.
UNAUTHENTICATED
,
'
Unauthenticated Access. Authorizations not found in the request.
'
));
return
;
}
}
// track caller to the main log
const
key
=
req
.
headers
[
'
x-api-key
'
]
as
string
;
const
logger
=
LoggerFactory
.
build
(
Config
.
CLOUDPROVIDER
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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