8000 chore: tests for authorization by outerlook · Pull Request #813 · trufnetwork/node · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: tests for authorization #813

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

Merged
merged 5 commits into from
Mar 3, 2025
Merged

chore: tests for authorization #813

merged 5 commits into from
Mar 3, 2025

Conversation

outerlook
Copy link
Contributor
@outerlook outerlook commented Mar 1, 2025

Implement Authorization Contract Tests

Description

  • Added comprehensive test suite for stream authorization behaviors, deleting old from common tests
  • Created utility functions to facilitate testing of auth-related procedures

Related Problem

How Has This Been Tested?

The implementation includes new test files that verify:

  • AUTH.01: Stream ownership and transfer
  • AUTH.02: Read permission controls
  • AUTH.03: Write permission controls
  • AUTH.04: Composition permission controls
  • AUTH.05: Stream deletion capability

Tests are run against both primitive and composed stream contracts to ensure consistent behavior.

@outerlook outerlook self-assigned this Mar 1, 2025
Implement detailed test suite for stream authorization behaviors:
- Stream ownership transfer
- Read permission control
- Write permission control
- Composition permission control

The tests cover various scenarios for AUTH.01 through AUTH.04, ensuring proper access management and permission validation across different stream types.
Remove previously implemented test cases for stream authorization, including:
- Ownership transfer tests
- Invalid Ethereum address handling
- Permissions after visibility change
- Stream composition permission tests

This cleanup simplifies the test suite while maintaining the core authorization contract behaviors defined in contracts_behaviors.md.
Reorganize authorization test suite by:
- Creating dedicated utility packages for test procedures and setup
- Extracting common helper functions into reusable methods
- Improving error handling and logging in test scenarios
- Simplifying test code structure and reducing duplication

The changes include:
- Adding `procedure` package for common test procedure calls
- Adding `setup` package for contract initialization and management
- Removing inline helper functions from test file
- Enhancing input structs for better type safety and readability
Update common test file to use new utility packages for:
- Contract setup and initialization
- Metadata and procedure operations
- Reducing code duplication
- Improving test readability and maintainability

Changes include:
- Removing inline helper functions
- Using new setup and procedure utility packages
- Updating function signatures to use new utility structs
- Cleaning up import statements
@outerlook outerlook marked this pull request as ready for review March 3, 2025 14:43
@outerlook outerlook requested a review from MicBun March 3, 2025 14:43
Update authorization contract behavior identifiers in documentation and tests:
- Remove dot notation from AUTH identifiers (e.g., AUTH.01 → AUTH01)
- Ensure consistent identifier format across contracts_behaviors.md and test files
- Maintain semantic meaning of authorization behavior descriptions
@outerlook outerlook requested a review from MicBun March 3, 2025 15:55
@MicBun MicBun enabled auto-merge (squash) March 3, 2025 15:55
Copy link
pr-time-tracker bot commented Mar 3, 2025

@outerlook
⚠️⚠️⚠️
You must submit the time spent on this PR.
⚠️⚠️⚠️

@MicBun MicBun merged commit 693fbb6 into main Mar 3, 2025
4 of 5 checks passed
78EC
@MicBun MicBun deleted the chore/auth-tests branch March 3, 2025 16:16
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.

Problem: Stream "Authorization" behaviors are untested
2 participants
0