Spaces:
Sleeping
Sleeping
Update src/main/java/com/example/config/SecurityConfig.java
Browse files
src/main/java/com/example/config/SecurityConfig.java
CHANGED
|
@@ -32,32 +32,7 @@ public class SecurityConfig {
|
|
| 32 |
.defaultSuccessUrl("/secure", true)
|
| 33 |
)
|
| 34 |
.logout(logout -> logout.logoutSuccessUrl("/"))
|
| 35 |
-
.oidcLogout(oidc -> oidc.backChannel(Customizer.withDefaults()))
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
.frameOptions(frame -> frame.sameOrigin())
|
| 40 |
-
.httpStrictTransportSecurity(hsts -> hsts
|
| 41 |
-
.includeSubDomains(true)
|
| 42 |
-
.maxAgeInSeconds(31536000)
|
| 43 |
-
)
|
| 44 |
-
.contentSecurityPolicy(csp -> csp
|
| 45 |
-
.policyDirectives("default-src 'self'; " +
|
| 46 |
-
"script-src 'self' 'unsafe-inline' 'unsafe-eval'; " +
|
| 47 |
-
"style-src 'self' 'unsafe-inline'; " +
|
| 48 |
-
"img-src 'self' data:; " +
|
| 49 |
-
"connect-src 'self' https://learnifymedhub-kc.hf.space; " +
|
| 50 |
-
"frame-ancestors 'self' https://huggingface.co; " + // Allow HF to frame your app
|
| 51 |
-
"form-action 'self';")
|
| 52 |
-
)
|
| 53 |
-
.referrerPolicy(referrer -> referrer
|
| 54 |
-
.policy(org.springframework.security.web.header.writers.ReferrerPolicyHeaderWriter.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN)
|
| 55 |
-
)
|
| 56 |
-
.permissionsPolicyHeader(permissions -> permissions
|
| 57 |
-
.policy("geolocation=(), microphone=(), camera=(), payment=(), usb=()")
|
| 58 |
-
)
|
| 59 |
-
);
|
| 60 |
-
|
| 61 |
-
return http.build();
|
| 62 |
-
}
|
| 63 |
-
}
|
|
|
|
| 32 |
.defaultSuccessUrl("/secure", true)
|
| 33 |
)
|
| 34 |
.logout(logout -> logout.logoutSuccessUrl("/"))
|
| 35 |
+
.oidcLogout(oidc -> oidc.backChannel(Customizer.withDefaults()));
|
| 36 |
+
return http.build();
|
| 37 |
+
}
|
| 38 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|