Skip to content

signature identity#366

Merged
alexviquez merged 17 commits intomainfrom
signature
Feb 18, 2025
Merged

signature identity#366
alexviquez merged 17 commits intomainfrom
signature

Conversation

@mike-one
Copy link
Copy Markdown
Collaborator

@mike-one mike-one commented Feb 11, 2025

closes #367

Summary by CodeRabbit

  • New Features
    • Enhanced verification record examples to include structured data with location, IP, and hash.
    • Expanded supported document types with a new "signature" option.
    • Added an optional signature field in user requests and updates for enhanced verification.
  • Chores
    • Updated the module version to 2.1.1.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 11, 2025

Walkthrough

The pull request introduces several updates across the module. The example value for the data field in the KYCFile class is updated from an empty dictionary to a structured dictionary that includes keys for location, ip, and hash. The version number is changed from 2.1.0 to 2.1.1, indicating a transition to a new stable release. Additionally, a new member, signature, is added to the KYCFileType enumeration, expanding the recognized file types for customer verification to include signatures. Furthermore, a new optional field signature of type Optional[KYCFile] is introduced in both the UserRequest and UserUpdateRequest classes to accommodate signature documents in user requests and updates. These changes do not alter existing functionality but enhance the data structure and example clarity.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa5081d and 226dab3.

📒 Files selected for processing (1)
  • cuenca_validations/version.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cuenca_validations/version.py

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (3c096db) to head (226dab3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #366   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines         1285      1288    +3     
=========================================
+ Hits          1285      1288    +3     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cuenca_validations/types/enums.py 100.00% <100.00%> (ø)
cuenca_validations/types/identities.py 100.00% <ø> (ø)
cuenca_validations/types/requests.py 100.00% <100.00%> (ø)
cuenca_validations/version.py 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c096db...226dab3. Read the comment docs.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
cuenca_validations/types/identities.py (1)

187-189: Consider adding hash algorithm information.

The hash field could benefit from additional validation and documentation about the expected hash algorithm and format.

Consider updating the field definition to include this information:

     hash: str = Field(
-        description="hash of the signature"
+        description="SHA-256 hash of the signature image",
+        min_length=64,
+        max_length=64,
+        pattern=r'^[a-f0-9]{64}$'
     )
🧰 Tools
🪛 GitHub Actions: test

[warning] 189-189: trailing whitespace

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c096db and 83c3a75.

📒 Files selected for processing (2)
  • cuenca_validations/types/__init__.py (2 hunks)
  • cuenca_validations/types/identities.py (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: test
cuenca_validations/types/identities.py

[warning] 189-189: trailing whitespace

🔇 Additional comments (2)
cuenca_validations/types/__init__.py (1)

77-77: LGTM!

The addition of Signature to the __all__ list and its import from .identities follow the existing patterns and maintain alphabetical ordering.

Also applies to: 171-171

cuenca_validations/types/identities.py (1)

177-199: LGTM!

The Signature class is well-structured and follows the established patterns in the codebase:

  • Inherits from BaseModel
  • Uses appropriate field types (str for uri/location/hash, IPvAnyAddress for ip)
  • Includes clear field descriptions
  • Provides a helpful example schema
🧰 Tools
🪛 GitHub Actions: test

[warning] 189-189: trailing whitespace

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
cuenca_validations/types/requests.py (1)

626-629: Add JSON schema example and field descriptions.

To maintain consistency with other request models in the codebase, consider adding:

  1. Field descriptions using Field(description="...").
  2. JSON schema example using model_config.
 class SignatureRequest(BaseRequest):
-    signature: Signature
-    user_id: str
+    signature: Signature = Field(
+        description="Signature details including URI, location, IP, and hash"
+    )
+    user_id: str = Field(description="ID of the user providing the signature")
+    model_config = ConfigDict(
+        json_schema_extra={
+            'example': {
+                'signature': {
+                    'uri': 'https://example.com/signatures/123',
+                    'location': 'Mexico City, MX',
+                    'ip': '192.168.1.1',
+                    'hash': 'abc123'
+                },
+                'user_id': 'USWqY5cvkISJOxHyEKjAKf8w'
+            }
+        }
+    )
🧰 Tools
🪛 GitHub Actions: test

[warning] 626-626: E302 expected 2 blank lines, found 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58dedd7 and c53b65b.

📒 Files selected for processing (2)
  • cuenca_validations/types/__init__.py (3 hunks)
  • cuenca_validations/types/requests.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cuenca_validations/types/init.py
🧰 Additional context used
🪛 GitHub Actions: test
cuenca_validations/types/requests.py

[warning] 626-626: E302 expected 2 blank lines, found 1

🔇 Additional comments (1)
cuenca_validations/types/requests.py (1)

36-36: LGTM!

The Signature import is correctly placed in alphabetical order within the existing import group.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80b419f and 994c74b.

📒 Files selected for processing (2)
  • cuenca_validations/types/identities.py (1 hunks)
  • cuenca_validations/version.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cuenca_validations/version.py
🧰 Additional context used
🪛 GitHub Actions: test
cuenca_validations/types/identities.py

[warning] 193-193: W292 no newline at end of file

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pytest (3.13)
  • GitHub Check: pytest (3.10)
  • GitHub Check: coverage
  • GitHub Check: publish-pypi

@mike-one mike-one requested a review from rogelioLpz February 13, 2025 21:08
@alexviquez alexviquez merged commit b8897d7 into main Feb 18, 2025
20 checks passed
@alexviquez alexviquez deleted the signature branch February 18, 2025 22:14
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.

Signature Cuenca-Validations

2 participants