Skip to content

Conversation

@majiayu000
Copy link

Summary

This PR fixes #253 by adding comprehensive test coverage for the validatePermissions function.

Changes

  • Added TestValidatePermissions with comprehensive test cases covering:
    • Valid single and multiple permissions (read, write, list, execute, super)
    • Invalid permission rejection (delete, admin, create, and typos like 'raed')
    • Mixed valid/invalid permission handling
    • Empty string handling
    • Whitespace trimming

Testing

All existing tests pass, and the new tests verify that the SDK's ValidatePermissions function properly rejects invalid permissions at validation time, preventing them from being stored in the database.


Generated with Claude Code

- Add TestValidatePermissions to verify permission validation works correctly
- Test valid permissions: read, write, list, execute, super
- Test invalid permissions: delete, admin, create, typos like 'raed'
- Ensures CLI properly rejects invalid permissions at validation time
- All tests pass, addressing issue spiffe#253

Signed-off-by: majiayu000 <[email protected]>
@v0lkan
Copy link
Contributor

v0lkan commented Dec 31, 2025

Thanks for your contribution 🙏 .

I will check this out next year :D

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.

Enhance Permission Validation

2 participants