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
Dataset
Commits
c0abd4d4
Commit
c0abd4d4
authored
Dec 07, 2021
by
Aman Verma
Browse files
adding dockerfile
parent
b3bcea61
Pipeline
#80664
passed with stages
in 22 minutes and 38 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dataset-core/pom.xml
View file @
c0abd4d4
...
...
@@ -151,14 +151,9 @@
<!-- swagger dependencies -->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
${springfox-version}
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
${springfox-version}
</version>
<groupId>
org.springdoc
</groupId>
<artifactId>
springdoc-openapi-ui
</artifactId>
<version>
1.5.12
</version>
</dependency>
</dependencies>
...
...
dataset-core/src/main/java/org/opengroup/osdu/dataset/swagger/HomeController.java
View file @
c0abd4d4
...
...
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
public
class
HomeController
{
@RequestMapping
(
value
=
"/swagger"
)
public
String
swagger
()
{
System
.
out
.
println
(
"swagger-ui.html"
);
return
"redirect:swagger-ui.html"
;
System
.
out
.
println
(
"swagger-ui
/index
.html"
);
return
"redirect:swagger-ui
/index
.html"
;
}
}
dataset-core/src/main/java/org/opengroup/osdu/dataset/swagger/SwaggerDocumentationConfig.java
deleted
100644 → 0
View file @
b3bcea61
// Copyright © 2021 Amazon Web Services
// Copyright 2017-2019, Schlumberger
//
// 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.dataset.swagger
;
import
org.opengroup.osdu.core.common.model.http.DpsHeaders
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Profile
;
import
springfox.documentation.builders.ParameterBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.ApiKey
;
import
springfox.documentation.service.AuthorizationScope
;
import
springfox.documentation.service.SecurityReference
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.contexts.SecurityContext
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.service.Parameter
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
@Configuration
@EnableSwagger2
@Profile
(
"!noswagger"
)
public
class
SwaggerDocumentationConfig
{
public
static
final
String
AUTHORIZATION_HEADER
=
"Authorization"
;
public
static
final
String
DEFAULT_INCLUDE_PATTERN
=
"/.*"
;
@Bean
public
Docket
api
()
{
ParameterBuilder
builder
=
new
ParameterBuilder
();
List
<
Parameter
>
parameters
=
new
ArrayList
<>();
builder
.
name
(
DpsHeaders
.
DATA_PARTITION_ID
)
.
description
(
"tenant"
)
.
defaultValue
(
"common"
)
.
modelRef
(
new
ModelRef
(
"string"
))
.
parameterType
(
"header"
)
.
required
(
true
)
.
build
();
parameters
.
add
(
builder
.
build
());
builder
.
name
(
"frame-of-reference"
)
.
description
(
"reference"
)
.
defaultValue
(
"none"
)
.
modelRef
(
new
ModelRef
(
"string"
))
.
parameterType
(
"header"
)
.
required
(
true
)
.
build
();
parameters
.
add
(
builder
.
build
());
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
globalOperationParameters
(
parameters
)
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"org.opengroup.osdu.dataset.api"
))
.
build
()
.
securityContexts
(
Collections
.
singletonList
(
securityContext
()))
.
securitySchemes
(
Collections
.
singletonList
(
apiKey
()));
}
private
ApiKey
apiKey
()
{
return
new
ApiKey
(
"JWT"
,
AUTHORIZATION_HEADER
,
"header"
);
}
private
SecurityContext
securityContext
()
{
return
SecurityContext
.
builder
()
.
securityReferences
(
defaultAuth
())
.
forPaths
(
PathSelectors
.
regex
(
DEFAULT_INCLUDE_PATTERN
))
.
build
();
}
List
<
SecurityReference
>
defaultAuth
()
{
AuthorizationScope
authorizationScope
=
new
AuthorizationScope
(
"global"
,
"accessEverything"
);
AuthorizationScope
[]
authorizationScopes
=
new
AuthorizationScope
[]{
authorizationScope
};
return
Collections
.
singletonList
(
new
SecurityReference
(
"JWT"
,
authorizationScopes
));
}
}
devops/azure/Dockerfile
0 → 100644
View file @
c0abd4d4
FROM
community.opengroup.org:5555/osdu/platform/deployment-and-operations/base-containers-azure/alpine-zulu8:0.0.3
VOLUME
/tmp
ARG
JAR_FILE=./provider/dataset-azure/target/dataset-azure-0.11.0-spring-boot.jar
ARG
APPLICATIONINSIGHTS_INSTRUMENTATION_KEY
COPY
${JAR_FILE} app.jar
ENV
DEFAULT_JVM_OPTS="-XX:InitialRAMPercentage=25.0 -XX:MaxRAMPercentage=50.0 -XX:+HeapDumpOnOutOfMemoryError"
ENV
JAVA_OPTS="${DEFAULT_JVM_OPTS} -javaagent:/opt/agents/applicationinsights-agent.jar ${JAVA_OPTS}"
ENTRYPOINT
exec java ${JAVA_OPTS} -jar /app.jar
\ No newline at end of file
provider/dataset-azure/src/main/java/org/opengroup/osdu/dataset/provider/azure/security/AADSecurityConfig.java
View file @
c0abd4d4
...
...
@@ -42,6 +42,10 @@ public class AADSecurityConfig extends WebSecurityConfigurerAdapter {
.
authorizeRequests
()
.
antMatchers
(
"/"
,
"/index.html"
,
"/v2/api-docs"
,
"/v3/api-docs"
,
"*/api-docs"
,
"/swagger-ui/index.html"
,
"*/swagger-ui.html"
,
"/configuration/ui"
,
"/swagger-resources/**"
,
"/configuration/security"
,
...
...
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