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
Schema
Commits
5787d9ea
Commit
5787d9ea
authored
Sep 01, 2021
by
Aman Verma
Browse files
moving interfaces from azure to schema-core
parent
a4289eca
Pipeline
#62217
passed with stages
in 29 minutes and 48 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
provider/schema-azure/src/main/java/org/opengroup/osdu/schema/azure/interfaces/ISchemaServiceAzure.java
deleted
100644 → 0
View file @
a4289eca
// Copyright © Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package
org.opengroup.osdu.schema.azure.interfaces
;
import
org.opengroup.osdu.schema.exceptions.ApplicationException
;
import
org.opengroup.osdu.schema.exceptions.BadRequestException
;
import
org.opengroup.osdu.schema.model.SchemaInfo
;
import
org.opengroup.osdu.schema.model.SchemaRequest
;
import
org.opengroup.osdu.schema.model.SchemaUpsertResponse
;
public
interface
ISchemaServiceAzure
{
/**
* This method creates a shared schema
* @param schemaRequest schema request
* @return Schema info of created schema
* @throws ApplicationException
* @throws BadRequestException
*/
SchemaInfo
createSystemSchema
(
SchemaRequest
schemaRequest
)
throws
ApplicationException
,
BadRequestException
;
/**
* This method first tries to update the schema with the given schema-id. If there is no schema found,
* it tries to create the new shared schema.
* @param schemaRequest schema request
* @return schema upsert response
* @throws ApplicationException
* @throws BadRequestException
*/
SchemaUpsertResponse
upsertSystemSchema
(
SchemaRequest
schemaRequest
)
throws
ApplicationException
,
BadRequestException
;
}
provider/schema-azure/src/main/java/org/opengroup/osdu/schema/azure/service/serviceimpl/AuthorizationServiceForServicePrincipalImpl.java
View file @
5787d9ea
package
org.opengroup.osdu.schema.azure.service.serviceimpl
;
import
org.opengroup.osdu.schema.azure.interfaces.IAuthorizationServiceForServicePrincipal
;
import
com.azure.spring.autoconfigure.aad.UserPrincipal
;
import
org.opengroup.osdu.schema.provider.interfaces.authorization.IAuthorizationServiceForServicePrincipal
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.stereotype.Component
;
...
...
provider/
schema-
azu
re/src/main/java/org/opengroup/osdu/schema/
azure
/interfaces/IAuthorizationServiceForServicePrincipal.java
→
schema-
co
re/src/main/java/org/opengroup/osdu/schema/
provider
/interfaces/
authorization/
IAuthorizationServiceForServicePrincipal.java
View file @
5787d9ea
package
org.opengroup.osdu.schema.
azure
.interfaces
;
package
org.opengroup.osdu.schema.
provider
.interfaces
.authorization
;
public
interface
IAuthorizationServiceForServicePrincipal
{
boolean
isDomainAdminServiceAccount
();
...
...
provider/
schema-
azu
re/src/main/java/org/opengroup/osdu/schema/
azure/auth
/AuthorizationFilterSP.java
→
schema-
co
re/src/main/java/org/opengroup/osdu/schema/
security
/AuthorizationFilterSP.java
View file @
5787d9ea
package
org.opengroup.osdu.schema.
azure.auth
;
package
org.opengroup.osdu.schema.
security
;
import
org.opengroup.osdu.core.common.model.http.DpsHeaders
;
import
org.opengroup.osdu.schema.
azure
.interfaces.IAuthorizationServiceForServicePrincipal
;
import
org.opengroup.osdu.schema.
provider
.interfaces.
authorization.
IAuthorizationServiceForServicePrincipal
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.context.annotation.RequestScope
;
...
...
@@ -20,4 +20,5 @@ public class AuthorizationFilterSP {
headers
.
put
(
DpsHeaders
.
USER_EMAIL
,
"ServicePrincipalUser"
);
return
authorizationService
.
isDomainAdminServiceAccount
();
}
}
schema-core/src/main/java/org/opengroup/osdu/schema/service/serviceimpl/SchemaService.java
View file @
5787d9ea
...
...
@@ -128,7 +128,7 @@ public class SchemaService implements ISchemaService {
/**
* Method to create schema
*
* @param schema request
* @param schema
Request
request
* @return schemaInfo.
* @throws JSONException
* @throws JsonProcessingException
...
...
@@ -392,7 +392,7 @@ public class SchemaService implements ISchemaService {
public
SchemaUpsertResponse
upsertSystemSchema
(
SchemaRequest
schemaRequest
)
throws
ApplicationException
,
BadRequestException
{
return
this
.
upsertSchemaInternal
(
schemaRequest
,
true
);
}
private
void
getSchemaInfos
(
QueryParams
queryParams
,
List
<
SchemaInfo
>
schemaList
,
String
tenant
)
throws
ApplicationException
{
...
...
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