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

attestation-agent: Extend ResourceUri to support query string #634

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

cclaudio
Copy link
Contributor

With this change, the kbs-client is able to send a get-resource request that includes the query string provided e.g.:

kbs-client --url http://127.0.0.1:8080
get-resource
--path 'plugin/nebula/credential?ip[ip]=10.11.12.13&ip[netbits]=21&name=pod1'

This is required by the KBS repository plugin interface.

Copy link
Member

@Xynnn007 Xynnn007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @cclaudio for this!

Comment on lines 175 to 178
const TEST_QS_URL: &str = "kbs:///plugin/plugname/resourcename?param1=value1&param2=value2";

#[test]
fn deserialize_qs() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, rstest definitely makes the code cleaner. Let me rework that test case

Copy link
Member

@fitzthum fitzthum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cclaudio
Copy link
Contributor Author

I will update this PR shortly with a edge case I forgot and also the test case clean-up

With this change, the kbs-client is able to send a get-resource request that
includes the query string provided e.g.:

kbs-client --url http://127.0.0.1:8080 \
           get-resource \
           --path 'plugin/nebula/credential?ip[ip]=10.11.12.13&ip[netbits]=21&name=pod1'

This is required by the KBS repository plugin interface.

Signed-off-by: Claudio Carvalho <cclaudio@linux.ibm.com>
@cclaudio
Copy link
Contributor Author

Done.

  • patched token_client.rs as well to support query string
  • merged all ResourceUri tests into one rstest test with multiple cases. Thanks @Xynnn007 for the feedback.

@fitzthum fitzthum merged commit 3db9f26 into confidential-containers:main Aug 2, 2024
20 checks passed
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.

3 participants