Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dariah
dariahsp
Commits
114b02a7
Commit
114b02a7
authored
Nov 09, 2020
by
Gradl, Tobias
Browse files
11: Reorganize and refactor core
Task-Url:
#11
parent
781bff81
Pipeline
#17795
passed with stage
in 1 minute and 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dariahsp-core/src/main/java/eu/dariah/de/dariahsp/web/controller/SAMLMetadataController.java
View file @
114b02a7
...
...
@@ -5,6 +5,7 @@ import org.springframework.http.MediaType;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
eu.dariah.de.dariahsp.error.NotFoundException
;
...
...
@@ -12,10 +13,11 @@ import eu.dariah.de.dariahsp.error.SAML2MetadataNotFoundException;
import
eu.dariah.de.dariahsp.helpers.SAMLMetadataHelper
;
@Controller
@RequestMapping
(
"/saml/metadata"
)
public
class
SAMLMetadataController
{
@Autowired
private
SAMLMetadataHelper
metadataHelper
;
@GetMapping
(
value
=
{
"
/saml/metadata"
,
"/saml/metadata
/{action}"
},
produces
=
MediaType
.
APPLICATION_XML_VALUE
)
@GetMapping
(
value
=
{
"
"
,
"/"
,
"
/{action}"
},
produces
=
MediaType
.
APPLICATION_XML_VALUE
)
public
@ResponseBody
String
getMetadata
(
@PathVariable
(
required
=
false
)
String
action
)
{
if
(
action
!=
null
&&
!
action
.
isEmpty
()
&&
!
action
.
equals
(
"generate"
)
&&
!
action
.
equals
(
"filesystem"
))
{
throw
new
NotFoundException
();
...
...
dariahsp-sample-boot/src/main/java/eu/dariah/de/dariahsp/sample/SampleApplication.java
View file @
114b02a7
...
...
@@ -3,9 +3,11 @@ package eu.dariah.de.dariahsp.sample;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.context.properties.ConfigurationPropertiesScan
;
import
org.springframework.context.annotation.ComponentScan
;
@SpringBootApplication
@ConfigurationPropertiesScan
@ComponentScan
({
"eu.dariah.de.dariahsp.sample"
,
"eu.dariah.de.dariahsp.web.controller"
})
public
class
SampleApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
dariahsp-sample-boot/src/main/java/eu/dariah/de/dariahsp/sample/controller/SampleController.java
View file @
114b02a7
...
...
@@ -18,10 +18,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
eu.dariah.de.dariahsp.config.SecurityConfig
;
import
eu.dariah.de.dariahsp.error.AuthenticatorNotAvailable
;
import
eu.dariah.de.dariahsp.web.AuthInfoHelper
;
import
eu.dariah.de.dariahsp.web.controller.SAMLMetadataController
;
@Controller
public
class
SampleController
extends
SAMLMetadataController
{
public
class
SampleController
{
private
static
String
INDEX_PAGE
=
"index"
;
@Autowired
private
SecurityConfig
securityConfig
;
...
...
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