Runway 1.1.0
This commit is contained in:
1 parent
ce217fc952
commit
07d5bd7e9a
223 files changed
+21147
-255
No files matched your search
@@ -72,6 +72,11 @@ public final class RunwaySpi {
|
||||
* is blocked), and blocks host linkage and Spring-surface violations instead of warning. A {@code 0.4.0}
|
||||
* – {@code 0.6.0} floor is a 1.x floor: the service tier those versions introduced is the 1.0
|
||||
* contract.</li>
|
||||
* <li><b>1.1.0</b> — one addition:
|
||||
* {@link mx.quest.runway.spi.service.PluginSettings#appSecret(String)} (a {@code default} method answering
|
||||
* 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>
|
||||
* </ul>
|
||||
*
|
||||
* <p>Before 0.4.0: 0.3.4 added {@link HeadContributor#headInputs(String)} (a {@code default} method returning an empty list:
|
||||
@@ -99,7 +104,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.0.0";
|
||||
public static final String VERSION = "1.1.0";
|
||||
|
||||
/**
|
||||
* The SPI version of the <b>running</b> kernel — unlike {@link #VERSION}, which the compiler inlines into the
|
||||
|
||||
@@ -25,8 +25,10 @@ import mx.quest.runway.spi.model.SettingsView;
|
||||
* next call returns the new values.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>App-level (platform-wide) plugin settings are not here: they bind through Spring
|
||||
* {@code @ConfigurationProperties} under {@code runway.plugin.<id>.*}, which is descriptor contract.
|
||||
* <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).
|
||||
*
|
||||
* @since SPI 0.4.0
|
||||
*/
|
||||
@@ -51,4 +53,27 @@ public interface PluginSettings {
|
||||
* @throws IllegalArgumentException if {@code siteId} is not a safe identifier
|
||||
*/
|
||||
Optional<String> secret(String siteId, String key);
|
||||
|
||||
/**
|
||||
* A {@code secret}-typed <b>app-level</b> setting of the calling plugin, in clear — the platform-wide twin of
|
||||
* {@link #secret(String, String)}, for a credential that belongs to the whole Runway (a database password, an
|
||||
* API key) rather than to one site.
|
||||
*
|
||||
* <p>The value is the one the <b>running</b> application was started with, read from the same environment
|
||||
* the plugin's {@code @ConfigurationProperties} bind from: an app-level setting saved on the console applies
|
||||
* on the next restart, and so does this answer. A stored {@code ENC(...)} value is decrypted; any other value
|
||||
* (a hand-written plaintext) is returned unchanged.
|
||||
*
|
||||
* <p>Empty when the key is not declared {@code type: secret} in the plugin's own {@code settings:} — a key
|
||||
* declared only in {@code siteSettings:} does not count, and no plugin can name another's — when it is unset
|
||||
* or blank, when it is encrypted but no platform secret key is configured, or when decryption fails (logged
|
||||
* once per key, never with the value).
|
||||
*
|
||||
* @param key the setting key as declared in {@code settings:}
|
||||
* @return the clear value, or empty
|
||||
* @since SPI 1.1.0
|
||||
*/
|
||||
default Optional<String> appSecret(String key) {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,9 @@ public interface PluginSiteFiles {
|
||||
* @return the text; empty when the file is absent, or the leaf is a directory or a symbolic link
|
||||
* @throws IllegalArgumentException if {@code siteId} or {@code relPath} is unsafe, or the path escapes the
|
||||
* subtree through a symbolic link
|
||||
* @throws IOException if the file is larger than the write cap, or cannot be read
|
||||
* @throws IOException if the file is larger than the write cap, or cannot be read — including when
|
||||
* whether it exists cannot be told (a folder that cannot be searched): only a
|
||||
* file that is certainly absent answers empty
|
||||
*/
|
||||
Optional<String> readText(String siteId, String relPath) throws IOException;
|
||||
|
||||
@@ -98,7 +100,7 @@ public interface PluginSiteFiles {
|
||||
*
|
||||
* @return the entries; empty when the folder is absent, is a file, or is a symbolic link
|
||||
* @throws IllegalArgumentException if a path is unsafe or escapes the subtree
|
||||
* @throws IOException if the folder cannot be read
|
||||
* @throws IOException if the folder cannot be read, or cannot be searched to tell whether it is there
|
||||
*/
|
||||
List<FileEntry> list(String siteId, String relDir) throws IOException;
|
||||
|
||||
@@ -107,7 +109,8 @@ public interface PluginSiteFiles {
|
||||
*
|
||||
* @return the entry; empty when absent, a symbolic link, or another kind of file
|
||||
* @throws IllegalArgumentException if a path is unsafe or escapes the subtree
|
||||
* @throws IOException if its attributes cannot be read
|
||||
* @throws IOException if its attributes cannot be read, or its folder cannot be searched to tell
|
||||
* whether it is there
|
||||
*/
|
||||
Optional<FileEntry> stat(String siteId, String relPath) throws IOException;
|
||||
}
|
||||
@@ -19,6 +19,8 @@ public interface Sites {
|
||||
*
|
||||
* @return the view, or empty when no site has this (well-formed) id
|
||||
* @throws IllegalArgumentException if {@code siteId} is not a safe identifier
|
||||
* @throws java.io.UncheckedIOException if the site's record cannot be read (since SPI 1.1.0; before, such a site
|
||||
* read as missing): a caller must not take that for "no such site"
|
||||
*/
|
||||
Optional<SiteView> find(String siteId);
|
||||
}
|
||||
@@ -28,7 +28,7 @@ class K3RecordsTest {
|
||||
|
||||
@Test
|
||||
void theSpiIsAtOneZero() {
|
||||
assertEquals("1.0.0", RunwaySpi.VERSION);
|
||||
assertEquals("1.1.0", RunwaySpi.VERSION);
|
||||
}
|
||||
|
||||
// --- LocalizedUrl ----------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user