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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

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.

Copy link

Failed to retrieve llama text: POST 400: {"error":{"code":400,"message":"the request exceeds the available context size. try increasing the context size or enable context shift","type":"invalid_request_error"}}

@1yam 1yam requested a review from nesitor June 13, 2025 12:04
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.

1 participant