Skip to content
GitLab
Menu
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
System
Storage
Commits
39b4cef8
Commit
39b4cef8
authored
Mar 12, 2021
by
Gokul Nagare
Browse files
tenant validation added
parent
2d465ab3
Pipeline
#31436
canceled with stages
in 28 minutes and 51 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
provider/storage-ibm/src/main/java/org/opengroup/osdu/storage/provider/ibm/QueryRepositoryImpl.java
View file @
39b4cef8
...
@@ -12,10 +12,12 @@ import java.util.ArrayList;
...
@@ -12,10 +12,12 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
javax.inject.Inject
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.HttpStatus
;
import
org.opengroup.osdu.core.common.model.http.AppException
;
import
org.opengroup.osdu.core.common.model.http.AppException
;
import
org.opengroup.osdu.core.common.model.storage.DatastoreQueryResult
;
import
org.opengroup.osdu.core.common.model.storage.DatastoreQueryResult
;
import
org.opengroup.osdu.core.common.model.tenant.TenantInfo
;
import
org.opengroup.osdu.core.ibm.auth.ServiceCredentials
;
import
org.opengroup.osdu.core.ibm.auth.ServiceCredentials
;
import
org.opengroup.osdu.core.ibm.cloudant.IBMCloudantClientFactory
;
import
org.opengroup.osdu.core.ibm.cloudant.IBMCloudantClientFactory
;
import
org.opengroup.osdu.storage.provider.interfaces.IQueryRepository
;
import
org.opengroup.osdu.storage.provider.interfaces.IQueryRepository
;
...
@@ -47,6 +49,9 @@ public class QueryRepositoryImpl implements IQueryRepository {
...
@@ -47,6 +49,9 @@ public class QueryRepositoryImpl implements IQueryRepository {
private
Database
dbSchema
;
private
Database
dbSchema
;
private
Database
dbRecords
;
private
Database
dbRecords
;
@Inject
private
TenantInfo
tenant
;
@PostConstruct
@PostConstruct
public
void
init
()
throws
MalformedURLException
{
public
void
init
()
throws
MalformedURLException
{
...
@@ -62,6 +67,12 @@ public class QueryRepositoryImpl implements IQueryRepository {
...
@@ -62,6 +67,12 @@ public class QueryRepositoryImpl implements IQueryRepository {
@Override
@Override
public
DatastoreQueryResult
getAllKinds
(
Integer
limit
,
String
cursor
)
{
public
DatastoreQueryResult
getAllKinds
(
Integer
limit
,
String
cursor
)
{
try
{
tenant
.
getName
();
}
catch
(
Exception
e
)
{
throw
new
AppException
(
HttpStatus
.
SC_UNAUTHORIZED
,
"not authorized"
,
"not authorized"
);
}
DatastoreQueryResult
result
=
new
DatastoreQueryResult
();
DatastoreQueryResult
result
=
new
DatastoreQueryResult
();
String
initialId
=
validateCursor
(
cursor
,
dbSchema
);
String
initialId
=
validateCursor
(
cursor
,
dbSchema
);
...
...
Write
Preview
Supports
Markdown
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