Skip to main content

static_idp_plugin/
config.rs

1//! Configuration for the static `IdP` plugin.
2
3use serde::Deserialize;
4
5#[derive(Debug, Clone, Deserialize)]
6#[serde(default, deny_unknown_fields)]
7pub struct StaticIdpPluginConfig {
8    /// Vendor name for GTS instance registration. Read by AM's
9    /// `choose_plugin_instance` filter to decide whether this plugin
10    /// matches the configured `idp.vendor`. Defaults to `"cf"` so a
11    /// stock deploy with `IdpConfig::default()` (which uses the
12    /// same `"cf"` default) resolves this plugin out-of-the-box.
13    pub vendor: String,
14
15    /// Plugin priority — lower wins on tie-breaks within the same
16    /// vendor. Defaults to `100` to leave headroom for higher-priority
17    /// vendor-specific deploys (e.g. a real `IdP` plugin with
18    /// `priority < 100`) to outrank the static echo if both happen
19    /// to publish under `vendor = "cf"`.
20    pub priority: i16,
21}
22
23impl Default for StaticIdpPluginConfig {
24    fn default() -> Self {
25        Self {
26            // Matches `account_management::config::IdpConfig::default().vendor`
27            // so the static echo plugin is the out-of-the-box answer
28            // when AM is deployed without an external IdP plugin.
29            vendor: "cf".to_owned(),
30            priority: 100,
31        }
32    }
33}