Skip to content

Conversation

forkimenjeckayang
Copy link
Collaborator

Summary

This PR implements validation for the batch_credential_issuance.batch_size parameter to ensure compliance with the OID4VCI specification, which requires that batch_size MUST be 2 or greater.

Changes Made

Implementation

  • Added validation in getBatchCredentialIssuance() method to check that batch_size is at least 2

Testing

  • Added comprehensive test method testBatchCredentialIssuanceValidation() covering:
    • Valid cases: batch sizes 2, 5 (should be accepted)
    • Invalid cases: batch sizes -1, 0, 1 (should be rejected)
    • Edge case: batch size exactly 2 (minimum valid value)
    • Created reusable helper method testBatchSizeValidation() to reduce code duplication
    • Ensured tests don't interfere with each other by properly restoring original realm attributes

Addresses

Copy link
Collaborator

@IngridPuppet IngridPuppet left a comment

Choose a reason for hiding this comment

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

Some minor comments, please could you check?

Copy link
Collaborator

@IngridPuppet IngridPuppet left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Keycloak: Update batch_credential_issuance to enforce batch_size ≥ 2.
3 participants