Skip to content

Feature: ipv4 and missing service #221

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 32 commits into from
Jun 26, 2025
Merged

Conversation

1yam
Copy link
Member

@1yam 1yam commented Jun 13, 2025

This PR add missing services inside the SDK crn scheduler dns port_forwarder and utils to simplify usage for instances

Related ClickUp, GitHub or Jira tickets : ALEPH-XXX

Self proofreading checklist

  • The new code clear, easy to read and well commented.
  • New code does not duplicate the functions of builtin or popular libraries.
  • An LLM was used to review the new code and look for simplifications.
  • New classes and functions contain docstrings explaining what they provide.
  • All new code is covered by relevant tests.

Changes

This pull request introduces significant enhancements to the Aleph SDK client, primarily focusing on service modularization, authenticated service registration, and improved API interactions. Key changes include the addition of several service classes, the ability to register services dynamically, and updates to existing methods to use new models and validation techniques.

Service Modularization and API Enhancements:

  • Added new service classes: Introduced modular service classes such as CrnService, DNSService, PortForwarder, AuthenticatedPortForwarder, and SchedulerService to encapsulate specific API interactions. These classes streamline operations like fetching CRN lists, managing DNS records, configuring port forwarding, and interacting with the scheduler API. (src/aleph/sdk/client/service/crn/http_crn.py - [1] src/aleph/sdk/client/service/dns/http_dns.py - [2] src/aleph/sdk/client/service/port_forwarder/http_port_forwarder.py - [3] src/aleph/sdk/client/service/port_forwarder/authenticated_port_forwarder.py - [4] src/aleph/sdk/client/service/scheduler/http_scheduler.py - [5]

  • Introduced BaseService and AggregateConfig: Added a generic base class BaseService and a container model AggregateConfig to handle aggregate data and simplify service implementations. (src/aleph/sdk/client/service/base.py - src/aleph/sdk/client/service/base.pyR1-R47)

Service Registration and Initialization:

  • Dynamic service registration: Added methods register_service and register_authenticated_service to dynamically register services for both authenticated and non-authenticated clients. This allows for flexible service instantiation during client initialization. (src/aleph/sdk/client/authenticated_http.py - [1] src/aleph/sdk/client/http.py - [2]

  • Service initialization in __aenter__: Enhanced the __aenter__ method in AlephHttpClient and AuthenticatedAlephHttpClient to initialize default and registered services when the client is entered. (src/aleph/sdk/client/authenticated_http.py - [1] src/aleph/sdk/client/http.py - [2]

Code Improvements:

These changes collectively enhance the SDK's flexibility, maintainability, and ease of use for developers interacting with the Aleph network.

@1yam 1yam requested a review from nesitor June 13, 2025 12:04
@1yam 1yam force-pushed the 1yam-ipv4-and-missing-service branch from 55fdfdc to 3a96bdf Compare June 16, 2025 11:45
Copy link
Member

@nesitor nesitor left a comment

Choose a reason for hiding this comment

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

There are different things to fix, like the delete_ports logic that shouldn't work, and also take into account the REMOVING status also on messages as valid as PROCESSED. Also, the test should be useful that these tests are not testing anything indeed.
The other are only method renaming suggestions to improve the clarity.

@aleph-im aleph-im deleted a comment from github-actions bot Jun 26, 2025
@nesitor nesitor self-requested a review June 26, 2025 13:39
@1yam 1yam force-pushed the 1yam-ipv4-and-missing-service branch from 24e9dc1 to a275c89 Compare June 26, 2025 14:50
@nesitor nesitor merged commit 30a2a2e into main Jun 26, 2025
38 checks passed
@nesitor nesitor deleted the 1yam-ipv4-and-missing-service branch June 26, 2025 15:31
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