Skip to content

Issue: Services are not properly scoped to modules #82

@danielmoumeny212

Description

@danielmoumeny212

While working with PyNest, I have noticed that services are not properly scoped within modules. Ideally, a service should only be accessible within the module where it is declared in the providers array, or in a module that imports it, provided the service is both in the providers and exports arrays of the exporting module.

However, it appears that each module can access services directly from the global container, without any strict validation to ensure that the requested service is either in the providers array of the module where it is being used, or in both the providers and exports arrays of a module that is being imported.

This lack of proper scoping leads to concerns about the isolation of services and could cause unexpected behaviors in the application.

Expected Behavior:
Services should be accessible only within the module where they are declared or properly imported and exported by another module.
There should be validation ensuring that services are not accessed globally without proper declaration in the relevant module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions