Skip to content

Conversation

@AmaseCocoa
Copy link
Member

Introduces keys property to Actor class, providing a unified list of
public_key and assertion_method. Adds get_key method to Actor for
retrieving keys by their ID.

AmaseCocoa and others added 5 commits December 23, 2025 16:21
  Introduces keys property to Actor class, providing a unified list of
  public_key and assertion_method. Adds get_key method to Actor for
  retrieving keys by their ID.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @AmaseCocoa, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Actor class by integrating robust key management capabilities. It introduces a unified property to access all associated cryptographic keys and a dedicated method for retrieving specific keys by their identifier. This improvement streamlines the handling of security-related properties for actors within the system, making key access more consistent and efficient. Additionally, the PR expands the public API of the apmodel package by exposing more core ActivityPub components.

Highlights

  • Actor Key Management: The Actor class now includes a keys property that provides a unified list of both public_key and assertion_method cryptographic keys associated with the actor.
  • Key Retrieval Method: A new get_key method has been added to the Actor class, allowing for convenient retrieval of a specific key by its ID from the actor's combined list of keys.
  • Module Exports: The src/apmodel/__init__.py file has been updated to expose a wider range of core ActivityPub model classes, including various activity types, collection types, and the Person and Note vocabularies, making them directly importable from the top-level apmodel package.
  • Documentation and Testing: The Actor class now has a comprehensive docstring, and new unit tests have been added to tests/test_actor.py to ensure the correct functionality of the new keys property and get_key method.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces valuable key retrieval functionality to the Actor class, including new properties and methods, along with corresponding tests. The implementation is straightforward. I have identified a few areas for improvement to enhance code quality and correctness. My main feedback points are a critical issue in src/apmodel/__init__.py where __all__ is incorrectly defined, a suggestion to use a more idiomatic Python pattern in src/apmodel/vocab/actor.py, and a style guide violation in tests/test_actor.py regarding import placement. Addressing these points will improve the overall quality of the code.

@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/apmodel/vocab/actor.py 88.88% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@AmaseCocoa AmaseCocoa merged commit 9a9c00f into develop Dec 23, 2025
10 checks passed
@AmaseCocoa AmaseCocoa deleted the feat/key-in-one branch December 23, 2025 07:45
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.

2 participants