-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add id to Applications for ApplicationManager #9
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe recent changes enhance the application's functionality through improved access control, security, and data management in smart contracts. New interfaces and contracts were introduced to manage permissions and attestations more effectively, while existing contracts underwent structural refinements for clarity and robustness. Additionally, the configuration and testing frameworks were updated to support these enhancements, ensuring a comprehensive and secure development environment. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant OIDAccessManager
participant OIDPermissionManager
User->>OIDAccessManager: Request Access
OIDAccessManager->>OIDPermissionManager: Check Permissions
OIDPermissionManager-->>OIDAccessManager: Return Permission Status
OIDAccessManager-->>User: Access Granted/Denied
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
contract OIDResolver is SchemaResolver, AccessManagedUpgradeable { | ||
error UnauthorizedAttester(address attester); | ||
|
||
constructor(IEAS initialEAS) SchemaResolver(initialEAS) {} | ||
|
||
modifier checkAttester(address attester) { | ||
_checkAttester(attester); | ||
_; | ||
} | ||
|
||
function initialize(address initialAuthority) public initializer { | ||
__AccessManaged_init(initialAuthority); | ||
} | ||
|
||
function onAttest( | ||
Attestation calldata attestation, | ||
uint256 value | ||
) | ||
internal | ||
virtual | ||
override | ||
checkAttester(attestation.attester) | ||
returns (bool) | ||
{ | ||
return true; | ||
} | ||
|
||
function onRevoke( | ||
Attestation calldata attestation, | ||
uint256 value | ||
) internal virtual override returns (bool) { | ||
return true; | ||
} | ||
|
||
function eas() public view returns (IEAS) { | ||
return _eas; | ||
} | ||
|
||
function _checkAttester(address attester) internal virtual { | ||
(bool isMember, ) = IAccessManager(authority()).hasRole(1, attester); | ||
if (!isMember) { | ||
revert UnauthorizedAttester(attester); | ||
} | ||
} | ||
} |
Check warning
Code scanning / Slither
Contracts that lock Ether Medium
Contract OIDResolver has payable functions:
- SchemaResolver.receive()
- SchemaResolver.attest(Attestation)
- SchemaResolver.multiAttest(Attestation[],uint256[])
- SchemaResolver.revoke(Attestation)
- SchemaResolver.multiRevoke(Attestation[],uint256[])
- ISchemaResolver.attest(Attestation)
- ISchemaResolver.multiAttest(Attestation[],uint256[])
- ISchemaResolver.revoke(Attestation)
- ISchemaResolver.multiRevoke(Attestation[],uint256[])
But does not have a function to withdraw the ether
function _checkAttester(address attester) internal virtual { | ||
(bool isMember, ) = IAccessManager(authority()).hasRole(1, attester); | ||
if (!isMember) { | ||
revert UnauthorizedAttester(attester); | ||
} | ||
} |
Check warning
Code scanning / Slither
Unused return Medium
function _checkAttester(address attester) internal virtual { | ||
(bool isMember, ) = IAccessManager(authority()).hasRole(1, attester); | ||
if (!isMember) { | ||
revert UnauthorizedAttester(attester); | ||
} | ||
} |
Check notice
Code scanning / Slither
Calls inside a loop Low
Summary by CodeRabbit
New Features
OIDAccessManager
for managing access control in the application.OIDPermissionManager
for structured permission management, allowing granting and revoking of permissions.OIDResolver
for managing attestations and integrated access management functionalities.ApplicationManager
contract with improved security features and structured input formats.Bug Fixes
Tests
OIDAccessManager
andOIDResolver
, validating deployment behaviors and permission handling.Chores