-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: security helper with list of should-be-public urls (#10134)
* chore: security helper with list of should-be-public urls * Removed VAADIN/** from public urls * Cleanup
- Loading branch information
Johannes Eriksson
authored
Mar 2, 2021
1 parent
f116492
commit ef84e6c
Showing
2 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
flow-server/src/main/java/com/vaadin/flow/internal/SecurityHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright 2000-2021 Vaadin Ltd. | ||
* | ||
* 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 com.vaadin.flow.internal; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.vaadin.flow.server.PwaConfiguration; | ||
import com.vaadin.flow.server.communication.PwaHandler; | ||
import com.vaadin.flow.server.frontend.FrontendUtils; | ||
|
||
/** | ||
* Helper methods for settigng up security contexts in Vaadin applications. | ||
* | ||
* @author Vaadin Ltd | ||
* | ||
*/ | ||
public final class SecurityHelper implements Serializable { | ||
|
||
/** | ||
* URLs matching these patterns should be publicly available for application | ||
* to work. Used for defining bypass rules in e.g. Spring Security. | ||
*/ | ||
public static final String[] PUBLIC_VAADIN_URLS = { | ||
"/favicon.ico", | ||
"/images/**", | ||
"/icons/**", | ||
"/" + PwaConfiguration.DEFAULT_PATH, | ||
"/" + FrontendUtils.SERVICE_WORKER_SRC_JS, | ||
PwaHandler.SW_RUNTIME_PRECACHE_PATH, | ||
"/" + PwaConfiguration.DEFAULT_OFFLINE_PATH | ||
}; | ||
|
||
private SecurityHelper() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters