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

Proposal 114: Add support for multiple API versions to the agent #115

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

ansasaki
Copy link
Contributor

This adds the proposal to add support for multiple API versions to the agent to make it backwards compatible.

Resolves #114

This adds the proposal to add support for multiple API versions to the
agent to make it backwards compatible.

Resolves keylime#114

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
@THS-on
Copy link
Member

THS-on commented Oct 17, 2024

Generally LGTM. Especially for the push model having the /version endpoint is a good idea on all your web components.

We already give the verifier the supported agent API version via the tenant, so we then need to implement some logic in the tenant to find the latest version supported by both.

@THS-on THS-on mentioned this pull request Oct 22, 2024
28 tasks
@ansasaki
Copy link
Contributor Author

@THS-on Thank you for the review! I'll merge this as it is, we can modify it in future if necessary.

@ansasaki ansasaki merged commit 394bdf0 into keylime:master Oct 31, 2024
1 check passed
@ansasaki ansasaki deleted the agent_multiple_api branch October 31, 2024 13:16
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Nov 1, 2024
Make the agent to provide the endpoints under multiple API versions
(currently only under versions 2.1 and 2.2).

A new configuration option is introduced, 'api_versions', which allows
the user to set the API versions to enable.  Only a subset of the
versions defined in api::SUPPORTED_API_VERSIONS can be enabled.  If a
unsupported version is set in the configuration, it will be ignored with
a warning.  The agent will fail to start if no valid API versions list
is configured.

The 'api_versions' option supports 2 keywords that can be used instead
of the explicit list of versions:

- "default": Enables all the supported API versions
- "latest": Enables only the latest supported API version

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 18, 2024
Make the agent to provide the endpoints under multiple API versions
(currently only under versions 2.1 and 2.2).

A new configuration option is introduced, 'api_versions', which allows
the user to set the API versions to enable.  Only a subset of the
versions defined in api::SUPPORTED_API_VERSIONS can be enabled.  If a
unsupported version is set in the configuration, it will be ignored with
a warning.  The agent will fail to start if no valid API versions list
is configured.

The 'api_versions' option supports 2 keywords that can be used instead
of the explicit list of versions:

- "default": Enables all the supported API versions
- "latest": Enables only the latest supported API version

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 18, 2024
The registrar_client module implements the builder pattern to allow
setting the optional parameters as needed.

This also implements the mechanism to allow the agent to communicate
with the registrar that support different API versions:

- The client will make a GET request to the '/version' endpoint of the
  registrar.  If the request is successful, the client will use the
  provided API version if it is enabled.
- If the registrar does not support the '/version' endpoint, the client
  will try to register using each of the enabled API versions, starting
  from the latest. If none of the enabled versions is supported by the
  registrar, the registration fails.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 18, 2024
Use the keylime::registrar_client module instead of the registrar_agent,
which is deleted.

This enables the agent to communicate with a registrar using an older
API version, restoring the backwards compatibility.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 18, 2024
The registrar_client module implements the builder pattern to allow
setting the optional parameters as needed.

This also implements the mechanism to allow the agent to communicate
with the registrar that support different API versions:

- The client will make a GET request to the '/version' endpoint of the
  registrar.  If the request is successful, the client will use the
  provided API version if it is enabled.
- If the registrar does not support the '/version' endpoint, the client
  will try to register using each of the enabled API versions, starting
  from the latest. If none of the enabled versions is supported by the
  registrar, the registration fails.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 18, 2024
Use the keylime::registrar_client module instead of the registrar_agent,
which is deleted.

This enables the agent to communicate with a registrar using an older
API version, restoring the backwards compatibility.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 19, 2024
The registrar_client module implements the builder pattern to allow
setting the optional parameters as needed.

This also implements the mechanism to allow the agent to communicate
with the registrar that support different API versions:

- The client will make a GET request to the '/version' endpoint of the
  registrar.  If the request is successful, the client will use the
  provided API version if it is enabled.
- If the registrar does not support the '/version' endpoint, the client
  will try to register using each of the enabled API versions, starting
  from the latest. If none of the enabled versions is supported by the
  registrar, the registration fails.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 19, 2024
Use the keylime::registrar_client module instead of the registrar_agent,
which is deleted.

This enables the agent to communicate with a registrar using an older
API version, restoring the backwards compatibility.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 20, 2024
Make the agent to provide the endpoints under multiple API versions
(currently only under versions 2.1 and 2.2).

A new configuration option is introduced, 'api_versions', which allows
the user to set the API versions to enable.  Only a subset of the
versions defined in api::SUPPORTED_API_VERSIONS can be enabled.  If a
unsupported version is set in the configuration, it will be ignored with
a warning.  The agent will fail to start if no valid API versions list
is configured.

The 'api_versions' option supports 2 keywords that can be used instead
of the explicit list of versions:

- "default": Enables all the supported API versions
- "latest": Enables only the latest supported API version

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 20, 2024
The registrar_client module implements the builder pattern to allow
setting the optional parameters as needed.

This also implements the mechanism to allow the agent to communicate
with the registrar that support different API versions:

- The client will make a GET request to the '/version' endpoint of the
  registrar.  If the request is successful, the client will use the
  provided API version if it is enabled.
- If the registrar does not support the '/version' endpoint, the client
  will try to register using each of the enabled API versions, starting
  from the latest. If none of the enabled versions is supported by the
  registrar, the registration fails.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 20, 2024
Use the keylime::registrar_client module instead of the registrar_agent,
which is deleted.

This enables the agent to communicate with a registrar using an older
API version, restoring the backwards compatibility.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/keylime that referenced this pull request Dec 20, 2024
The introduced configuraton option allows the user to select a subset of
the supported API versions to enable.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 20, 2024
Validate the values set in the `api_versions` configuration option, and
filter only the supported versions.

The configured versions are also sorted so that the agent can try the
enabled versions from the newest to the oldest.

If none of the configured options are supported, fallback to use all the
supported API versions instead.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to keylime/keylime that referenced this pull request Dec 23, 2024
The introduced configuraton option allows the user to select a subset of
the supported API versions to enable.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 23, 2024
Make the agent to provide the endpoints under multiple API versions
(currently only under versions 2.1 and 2.2).

A new configuration option is introduced, 'api_versions', which allows
the user to set the API versions to enable.  Only a subset of the
versions defined in api::SUPPORTED_API_VERSIONS can be enabled.  If a
unsupported version is set in the configuration, it will be ignored with
a warning.  The agent will fail to start if no valid API versions list
is configured.

The 'api_versions' option supports 2 keywords that can be used instead
of the explicit list of versions:

- "default": Enables all the supported API versions
- "latest": Enables only the latest supported API version

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 23, 2024
The registrar_client module implements the builder pattern to allow
setting the optional parameters as needed.

This also implements the mechanism to allow the agent to communicate
with the registrar that support different API versions:

- The client will make a GET request to the '/version' endpoint of the
  registrar.  If the request is successful, the client will use the
  provided API version if it is enabled.
- If the registrar does not support the '/version' endpoint, the client
  will try to register using each of the enabled API versions, starting
  from the latest. If none of the enabled versions is supported by the
  registrar, the registration fails.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 23, 2024
Use the keylime::registrar_client module instead of the registrar_agent,
which is deleted.

This enables the agent to communicate with a registrar using an older
API version, restoring the backwards compatibility.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 23, 2024
Validate the values set in the `api_versions` configuration option, and
filter only the supported versions.

The configured versions are also sorted so that the agent can try the
enabled versions from the newest to the oldest.

If none of the configured options are supported, fallback to use all the
supported API versions instead.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 23, 2024
Use the keylime::registrar_client module instead of the registrar_agent,
which is deleted.

This enables the agent to communicate with a registrar using an older
API version, restoring the backwards compatibility.

This also removes the unnecessary `API_VERSION` from `common.rs`.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
ansasaki added a commit to ansasaki/rust-keylime that referenced this pull request Dec 23, 2024
Validate the values set in the `api_versions` configuration option, and
filter only the supported versions.

The configured versions are also sorted so that the agent can try the
enabled versions from the newest to the oldest.

If none of the configured options are supported, fallback to use all the
supported API versions instead.

This is part of the implementation of the enhancement proposal 114:
keylime/enhancements#115

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for multiple API versions to the agent
2 participants