Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Storage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Storage
Commits
761414f7
Commit
761414f7
authored
2 years ago
by
Alok Joshi
Browse files
Options
Downloads
Patches
Plain Diff
bypass info and swagger apis in collaboration filter
parent
1bc9698b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!744
Upgraded packages to mitigated vulns in netty, guava, snakeyaml
,
!626
Bypass info and swagger apis in collaboration filter
Pipeline
#167352
failed
2 years ago
Stage: review
Stage: build
Stage: coverage
Stage: containerize
Stage: scan
Stage: deploy
Stage: integration
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
storage-core/src/main/java/org/opengroup/osdu/storage/util/CollaborationFilter.java
+9
-3
9 additions, 3 deletions
.../org/opengroup/osdu/storage/util/CollaborationFilter.java
with
9 additions
and
3 deletions
storage-core/src/main/java/org/opengroup/osdu/storage/util/CollaborationFilter.java
+
9
−
3
View file @
761414f7
...
...
@@ -22,8 +22,6 @@ import static org.opengroup.osdu.storage.util.StringConstants.COLLABORATIONS_FEA
@Component
public
class
CollaborationFilter
implements
Filter
{
public
static
final
String
X_COLLABORATION_HEADER_NAME
=
"x-collaboration"
;
private
static
final
String
DATA_PARTITION_ID
=
"data-partition-id"
;
@Autowired
public
IFeatureFlag
collaborationFeatureFlag
;
...
...
@@ -31,10 +29,18 @@ public class CollaborationFilter implements Filter {
@Override
public
void
doFilter
(
ServletRequest
request
,
ServletResponse
response
,
FilterChain
chain
)
throws
IOException
,
ServletException
{
HttpServletRequest
httpRequest
=
(
HttpServletRequest
)
request
;
if
(
httpRequest
.
getRequestURI
().
contains
(
"info"
)
||
httpRequest
.
getRequestURI
().
contains
(
"swagger"
)
||
httpRequest
.
getRequestURI
().
contains
(
"health"
)
||
httpRequest
.
getRequestURI
().
contains
(
"api-docs"
))
return
;
HttpServletResponse
httpResponse
=
(
HttpServletResponse
)
response
;
if
(!
collaborationFeatureFlag
.
isFeatureEnabled
(
COLLABORATIONS_FEATURE_NAME
))
{
String
collaborationHeader
=
((
HttpServletRequest
)
request
)
.
getHeader
(
X_COLLABORATION_HEADER_NAME
);
String
collaborationHeader
=
httpRequest
.
getHeader
(
X_COLLABORATION_HEADER_NAME
);
if
(!
Strings
.
isNullOrEmpty
(
collaborationHeader
))
{
httpResponse
.
setContentType
(
MediaType
.
APPLICATION_JSON_VALUE
);
httpResponse
.
setStatus
(
HttpStatus
.
SC_LOCKED
);
...
...
This diff is collapsed.
Click to expand it.
Alok Joshi
@ajoshi19
mentioned in commit
0ec487b0
·
2 years ago
mentioned in commit
0ec487b0
mentioned in commit 0ec487b01633b831369098f37ba1a2619712c8b8
Toggle commit list
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment