-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: generic 7.0.0 usage, regex engine moved to generic, @DISCOVERABLE
- Loading branch information
Showing
32 changed files
with
225 additions
and
721 deletions.
There are no files selected for viewing
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
...va/ch/sbb/polarion/extension/pdf/exporter/rest/controller/ConfigurationApiController.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
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
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
2 changes: 1 addition & 1 deletion
2
src/main/java/ch/sbb/polarion/extension/pdf/exporter/rest/model/WorkItemRefData.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
21 changes: 0 additions & 21 deletions
21
.../ch/sbb/polarion/extension/pdf/exporter/rest/model/configuration/ConfigurationStatus.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/main/java/ch/sbb/polarion/extension/pdf/exporter/rest/model/configuration/Status.java
This file was deleted.
Oops, something went wrong.
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
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
2 changes: 1 addition & 1 deletion
2
src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/LiveDocCommentsProcessor.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
31 changes: 31 additions & 0 deletions
31
...in/java/ch/sbb/polarion/extension/pdf/exporter/util/configuration/CORSStatusProvider.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,31 @@ | ||
package ch.sbb.polarion.extension.pdf.exporter.util.configuration; | ||
|
||
import ch.sbb.polarion.extension.generic.configuration.ConfigurationStatus; | ||
import ch.sbb.polarion.extension.generic.configuration.ConfigurationStatusProvider; | ||
import ch.sbb.polarion.extension.generic.configuration.Status; | ||
import ch.sbb.polarion.extension.generic.util.Discoverable; | ||
import com.polarion.core.config.Configuration; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Set; | ||
|
||
@Discoverable | ||
public class CORSStatusProvider extends ConfigurationStatusProvider { | ||
|
||
public static final String CORS = "CORS (Cross-Origin Resource Sharing)"; | ||
|
||
@Override | ||
public @NotNull ConfigurationStatus getStatus(@NotNull Context context) { | ||
boolean restEnabled = Configuration.getInstance().rest().enabled(); | ||
if (restEnabled) { | ||
Set<String> corsAllowedOrigins = Configuration.getInstance().rest().corsAllowedOrigins(); | ||
if (corsAllowedOrigins.isEmpty()) { | ||
return new ConfigurationStatus(CORS, Status.WARNING, "CORS allowed origins are not configured"); | ||
} else { | ||
return new ConfigurationStatus(CORS, Status.OK, "CORS allowed origins: %s".formatted(corsAllowedOrigins.stream().toList())); | ||
} | ||
} else { | ||
return new ConfigurationStatus(CORS, Status.WARNING, "Polarion REST API is not enabled, so CORS is not enabled"); | ||
} | ||
} | ||
} |
Oops, something went wrong.