Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.6 broken json config #3938

Closed
kfox1111 opened this issue Mar 2, 2023 · 0 comments · Fixed by #3939
Closed

1.6 broken json config #3938

kfox1111 opened this issue Mar 2, 2023 · 0 comments · Fixed by #3939
Labels
priority/urgent Issue is approved and is must be completed in the assigned milestone
Milestone

Comments

@kfox1111
Copy link
Contributor

kfox1111 commented Mar 2, 2023

This config works under 1.5.4 but under 1.6.0 now throws:

plugin item expected to have two keys (type then name)

config:

{
  "health_checks": {
    "bind_address": "0.0.0.0",
    "bind_port": "8080",
    "listener_enabled": true,
    "live_path": "/live",
    "ready_path": "/ready"
  },
  "plugins": {
    "DataStore": [
      {
        "sql": [
          {
            "plugin_data": [
              {
                "connection_string": "/run/spire/data/datastore.sqlite3",
                "database_type": "sqlite3"
              }
            ]
          }
        ]
      }
    ],
    "KeyManager": [
      {
        "disk": [
          {
            "plugin_data": [
              {
                "keys_path": "/run/spire/data/keys.json"
              }
            ]
          }
        ]
      }
    ],
    "NodeAttestor": [
      {
        "k8s_psat": [
          {
            "plugin_data": [
              {
                "clusters": [
                  {
                    "example-cluster": [
                      {
                        "service_account_allow_list": [
                          "default:spire-1234-agent"
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "Notifier": [
      {
        "k8sbundle": [
          {
            "plugin_data": {
              "config_map": "spire-bundle",
              "namespace": "default"
            }
          }
        ]
      }
    ]
  },
  "server": {
    "bind_address": "0.0.0.0",
    "bind_port": "8081",
    "ca_key_type": "rsa-2048",
    "ca_subject": [
      {
        "common_name": "example.org",
        "country": [
          "NL"
        ],
        "organization": [
          "Example"
        ]
      }
    ],
    "data_dir": "/run/spire/data",
    "default_jwt_svid_ttl": "1h",
    "default_x509_svid_ttl": "1h",
    "jwt_issuer": "oidc-discovery.example.org",
    "log_level": "info",
    "trust_domain": "example.org"
  }
}
azdagron added a commit to azdagron/spire that referenced this issue Mar 2, 2023
Recent changes to the plugin config parsing to retain plugin order
failed to account for the more verbose HCL or JSON forms.

This PR fixes the code to handle these forms as well as prevents
duplicate declarations, which was accidentally allowed as part of the
previous change.

Fixes: spiffe#3938

Signed-off-by: Andrew Harding <azdagron@gmail.com>
@evan2645 evan2645 added the priority/urgent Issue is approved and is must be completed in the assigned milestone label Mar 2, 2023
@evan2645 evan2645 added this to the 1.6.2 milestone Mar 2, 2023
MarcosDY pushed a commit that referenced this issue Mar 2, 2023
* Fix plugin config parsing code

Recent changes to the plugin config parsing to retain plugin order
failed to account for the more verbose HCL or JSON forms.

This PR fixes the code to handle these forms as well as prevents
duplicate declarations, which was accidentally allowed as part of the
previous change.

Fixes: #3938

Signed-off-by: Andrew Harding <azdagron@gmail.com>

* Add another test case

Signed-off-by: Andrew Harding <azdagron@gmail.com>

---------

Signed-off-by: Andrew Harding <azdagron@gmail.com>
@amartinezfayo amartinezfayo modified the milestones: 1.6.2, 1.6.3 Apr 5, 2023
stevend-uber pushed a commit to stevend-uber/spire that referenced this issue Oct 16, 2023
* Fix plugin config parsing code

Recent changes to the plugin config parsing to retain plugin order
failed to account for the more verbose HCL or JSON forms.

This PR fixes the code to handle these forms as well as prevents
duplicate declarations, which was accidentally allowed as part of the
previous change.

Fixes: spiffe#3938

Signed-off-by: Andrew Harding <azdagron@gmail.com>

* Add another test case

Signed-off-by: Andrew Harding <azdagron@gmail.com>

---------

Signed-off-by: Andrew Harding <azdagron@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/urgent Issue is approved and is must be completed in the assigned milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants