Skip to content

FI-4186: UDAP Attestation tests#41

Merged
edeyoung merged 13 commits into
mainfrom
fi-4186-attestation-tests
Jul 21, 2025
Merged

FI-4186: UDAP Attestation tests#41
edeyoung merged 13 commits into
mainfrom
fi-4186-attestation-tests

Conversation

@ChristineDuong
Copy link
Copy Markdown
Contributor

Summary

This PR adds attestation tests for the UDAP Security Test Kit. Tests are based on requirements that can be found here; tests are added based on not having existing coverage in generated coverage csv.

Tests are added to both client and server suite.

@ChristineDuong ChristineDuong requested a review from edeyoung June 30, 2025 10:40
@ChristineDuong ChristineDuong force-pushed the fi-4186-attestation-tests branch from 147317b to 4f3bcb2 Compare June 30, 2025 10:42
Copy link
Copy Markdown

@edeyoung edeyoung left a comment

Choose a reason for hiding this comment

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

Please address the ruby linter errors and the items in the comments.
I'll do another pass after.
Thanks!

@@ -0,0 +1,45 @@
module UDAPSecurityTestKit
class AuthorizationCodeUsageAttestationTest < Inferno::Test
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This class name is duplicated, which is causing the code to fail to run.
This class name must be unique.

- Ensuring the authorization code is not used more than once.
- Requesting an authorization code as per Section 4.1.1 of RFC 6749.
)
verifies_requirements 'hl7.fhir.us.udap-security@136',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

hl7.fhir.us.udap-security should be hl7.fhir.us.udap-security_1.0.0

You can see this in the excel file in the metadata tab:

image

It's also referenced in the suite lib/udap_security_test_kit.rb:

    requirement_sets(
      {
        identifier: 'hl7.fhir.us.udap-security_1.0.0',
        title: 'Security for Scalable Registration, Authentication, and Authorization (UDAP)',
        actor: 'Server'
      }
    )

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

One way to check that you're referencing things as expected is to look at the coverage document lib/udap_security_test_kit/requirements/generated/udap_security_client_requirements_coverage.csv. You can see in the client coverage document that there are no test ids associated with these requirements ids
image

Copy link
Copy Markdown

@edeyoung edeyoung left a comment

Choose a reason for hiding this comment

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

Added comments based on our discussion yesterday

@@ -0,0 +1,45 @@
module UDAPSecurityTestKit
class AuthorizationCodeUsageAttestationTest < Inferno::Test
title 'Authorization code is used correctly'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Per discussion, make titles verb first: "Uses authorization code correctly"

Change throughout

verifies_requirements 'hl7.fhir.us.udap-security@184'

input :access_token_lifetime_correct,
title: "Access tokens have a lifetime of no longer than 60 minutes",
Copy link
Copy Markdown

@edeyoung edeyoung Jul 9, 2025

Choose a reason for hiding this comment

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

Per discussion, put section title here and then colon:

title: "Authorization Code and Token Requests: Limits access token lifetime",

Repeat throughout

@@ -0,0 +1,40 @@
module UDAPSecurityTestKit
class AccessTokenLifetimeAttestationTest < Inferno::Test
title 'Access tokens have a lifetime of no longer than 60 minutes'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Per discussion, make verb first. An idea here is "Limits access token lifetime"

title 'Authorization code is used correctly'
id :udap_security_client_auth_code_usage
description %(
Client applications SHALL use the authorization code correctly by:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Per discussion, description here should align with the input description, removing "I attest..." text.

Change throughout.

@ChristineDuong ChristineDuong requested a review from edeyoung July 10, 2025 13:49
Copy link
Copy Markdown

@edeyoung edeyoung left a comment

Choose a reason for hiding this comment

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

I've requested a few formatting / viewing changes.

I've also noticed that several tests are uncovered. We don't need to get to 100% coverage, but it would be good to note which SHALL/SHALL NOT requirements are uncovered and why. This could be recorded for now in the "Notes" column of the excel spreadsheet.

image

Server-side organization makes sense to me. The only possible change would be the error handling ones as those are cross-cutting, and I could see them making more sense in their parent groupings, but I can see it either way so it can stay as is.

@edeyoung
Copy link
Copy Markdown

Looks good other than lack of coverage around requirements 258-269. Is there a reason these aren't covered? If so, document (excel file is ok for now). Same with all other SHALL/SHALL NOT requirements.
image

@ChristineDuong
Copy link
Copy Markdown
Contributor Author

Looks good other than lack of coverage around requirements 258-269. Is there a reason these aren't covered? If so, document (excel file is ok for now). Same with all other SHALL/SHALL NOT requirements. image

They were covered in AuthenticationRequestValidationAttestationTest (:oidc_auth_request_validation) which was erroneously not being called but should be fixed now!

Copy link
Copy Markdown

@edeyoung edeyoung left a comment

Choose a reason for hiding this comment

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

Looks good!

@vanessuniq vanessuniq mentioned this pull request Jul 21, 2025
@edeyoung edeyoung merged commit fd27b3b into main Jul 21, 2025
4 checks passed
@edeyoung edeyoung deleted the fi-4186-attestation-tests branch July 21, 2025 18:50
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.

2 participants