Runway 1.2.0
This commit is contained in:
1 parent
5fa0c1ef9f
commit
9144c206be
90 files changed
+2737
-554
No files matched your search
+1
-1
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>mx.quest</groupId>
|
||||
<artifactId>runway</artifactId>
|
||||
<version>1.1.2</version>
|
||||
<version>1.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>runway-spi</artifactId>
|
||||
|
||||
@@ -77,6 +77,11 @@ public final class RunwaySpi {
|
||||
* empty), the calling plugin's own {@code secret}-typed <b>app-level</b> setting in clear. Before, such a
|
||||
* setting reached the plugin only in its stored {@code ENC(...)} form, which a plugin cannot decrypt. A
|
||||
* plugin that calls it declares {@code requiresSpi: ">=1.1.0"}.</li>
|
||||
* <li><b>1.2.0</b> — one addition:
|
||||
* {@link mx.quest.runway.spi.service.PluginSettings#savedApp(String)} (a {@code default} method answering
|
||||
* empty), the calling plugin's own app-level setting as saved now rather than as the running application
|
||||
* started with it, so a plugin can check settings before the restart that applies them. A plugin that
|
||||
* calls it declares {@code requiresSpi: ">=1.2.0"}.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>Before 0.4.0: 0.3.4 added {@link HeadContributor#headInputs(String)} (a {@code default} method returning an empty list:
|
||||
@@ -104,7 +109,7 @@ public final class RunwaySpi {
|
||||
* {@link mx.quest.runway.spi.model.WidgetView} (with the old-arity constructor kept). All additive and
|
||||
* binary-compatible (no existing member changed).
|
||||
*/
|
||||
public static final String VERSION = "1.1.0";
|
||||
public static final String VERSION = "1.2.0";
|
||||
|
||||
/**
|
||||
* The SPI version of the <b>running</b> kernel — unlike {@link #VERSION}, which the compiler inlines into the
|
||||
|
||||
@@ -28,7 +28,9 @@ import mx.quest.runway.spi.model.SettingsView;
|
||||
* <p>App-level (platform-wide) plugin settings ({@code settings:} in {@code plugin.yml}) bind through Spring
|
||||
* {@code @ConfigurationProperties} under {@code runway.plugin.<id>.*}, which is descriptor contract. The one
|
||||
* exception is a {@code secret}-typed app-level setting: it binds there only in its stored {@code ENC(...)} form, so
|
||||
* {@link #appSecret(String)} hands it out in clear (since SPI 1.1.0).
|
||||
* {@link #appSecret(String)} hands it out in clear (since SPI 1.1.0). Those bindings are the values the running
|
||||
* application started with; {@link #savedApp(String)} reads what is saved now, which a restart will apply (since SPI
|
||||
* 1.2.0).
|
||||
*
|
||||
* @since SPI 0.4.0
|
||||
*/
|
||||
@@ -76,4 +78,25 @@ public interface PluginSettings {
|
||||
default Optional<String> appSecret(String key) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* An <b>app-level</b> setting of the calling plugin as it is <b>saved now</b>, which may differ from the running
|
||||
* value until the restart that applies it. It lets a plugin check settings before that restart, for example by
|
||||
* testing a connection with them.
|
||||
*
|
||||
* <p>The answer is the value stored in the plugin's app-level settings file when it is not blank (a {@code secret}
|
||||
* in clear, decrypted as {@link #appSecret(String)} does), otherwise the declared default of a non-secret
|
||||
* setting, otherwise empty. It is read from the file on each call, so call it when needed rather than in a loop.
|
||||
*
|
||||
* <p>Empty when the key is not declared in the plugin's own {@code settings:} (a key declared only in
|
||||
* {@code siteSettings:} does not count, and no plugin can name another's), and for an encrypted secret that
|
||||
* cannot be decrypted (logged once per key, never with the value).
|
||||
*
|
||||
* @param key the setting key as declared in {@code settings:}
|
||||
* @return the saved value, or empty
|
||||
* @since SPI 1.2.0
|
||||
*/
|
||||
default Optional<String> savedApp(String key) {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ class K3RecordsTest {
|
||||
|
||||
@Test
|
||||
void theSpiIsAtOneZero() {
|
||||
assertEquals("1.1.0", RunwaySpi.VERSION);
|
||||
assertEquals("1.2.0", RunwaySpi.VERSION);
|
||||
}
|
||||
|
||||
// --- LocalizedUrl ----------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user