Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Automate
Agent sessions
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
Portal
Commits
783e2dc9
Commit
783e2dc9
authored
3 months ago
by
Ruben Backx
Browse files
Options
Downloads
Patches
Plain Diff
Fix security
parent
8d93d6c9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#1272097
failed
3 months ago
Stage: build
Stage: static analysis
Stage: test
Stage: report
Stage: deploy
Stage: live checks
Changes
2
Pipelines
6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.gradle.kts
+1
-1
1 addition, 1 deletion
build.gradle.kts
src/main/java/nl/tudelft/portal/security/PortalSecurityConfigurerAdapter.java
+6
-26
6 additions, 26 deletions
...elft/portal/security/PortalSecurityConfigurerAdapter.java
with
7 additions
and
27 deletions
build.gradle.kts
+
1
−
1
View file @
783e2dc9
...
...
@@ -10,7 +10,7 @@ version = "1.1.0"
val
javaVersion
=
JavaVersion
.
VERSION_21
val
labradoorVersion
=
"1.7.0"
val
libradorVersion
=
"1.
5.0
"
val
libradorVersion
=
"1.
4.1
"
val
chihuahUIVersion
=
"1.2.2"
val
commonsVersion
=
"3.2.2"
val
jaegerVersion
=
"3.3.1"
...
...
This diff is collapsed.
Click to expand it.
src/main/java/nl/tudelft/portal/security/PortalSecurityConfigurerAdapter.java
+
6
−
26
View file @
783e2dc9
...
...
@@ -17,43 +17,23 @@
*/
package
nl.tudelft.portal.security
;
import
static
org
.
springframework
.
security
.
web
.
util
.
matcher
.
AntPathRequestMatcher
.
antMatcher
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.
security.config.annotation.method.configuration.EnableMethodSecurity
;
import
org.springframework.
core.annotation.Order
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
;
import
nl.tudelft.labracore.lib.security.LabradorSecurityConfig
;
// import static org.springframework.security.web.util.matcher.
// .AntPathRequestMatcher.antMatcher;
@Order
(
22
)
@Configuration
//@RequiredArgsConstructor
//@EnableWebMvc
@EnableMethodSecurity
@EnableWebSecurity
public
class
PortalSecurityConfigurerAdapter
extends
LabradorSecurityConfig
{
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
// MvcRequestMatcher.Builder mvcMatcherBuilder = new MvcRequestMatcher.Builder(introspector).servletPath("/path");
// Homepage can be loaded without authentication, but all other request need authentication first
http
.
authorizeHttpRequests
(
auth
->
auth
.
requestMatchers
(
antMatcher
(
"/"
)).
permitAll
()
.
requestMatchers
(
antMatcher
(
"/font/**"
)).
permitAll
()
.
requestMatchers
(
antMatcher
(
"/css/**"
)).
permitAll
()
.
requestMatchers
(
antMatcher
(
"/js/**"
)).
permitAll
()
.
requestMatchers
(
antMatcher
(
"/img/**"
)).
permitAll
()
.
requestMatchers
(
antMatcher
(
"/webjars/**"
)).
permitAll
()
.
requestMatchers
(
antMatcher
(
"/privacy"
)).
permitAll
()
.
requestMatchers
(
antMatcher
(
"/error/**"
)).
permitAll
()
.
requestMatchers
(
antMatcher
(
"/favicon.ico"
)).
permitAll
()
.
requestMatchers
(
antMatcher
(
"/h2-console"
)).
permitAll
()
.
anyRequest
()
.
authenticated
());
// return http.build();
.
requestMatchers
(
"/"
,
"/font/**"
,
"/css/**"
,
"/js/**"
,
"/img/**"
,
"/webjars/**"
,
"/privacy"
,
"/error/**"
,
"/favicon.ico"
)
.
permitAll
()
.
anyRequest
().
authenticated
());
}
}
This diff is collapsed.
Click to expand it.
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
sign in
to comment