Skip to content

[Feature] Support Authentication (Username/Password) and Namespace/Group/Service filtering for Nacos service discovery #4098

@pentium100

Description

@pentium100

Feature Request

Nacos service discovery does not support username/password configuration, nor does it support filtering by namespace, group name, or service name.

Currently, when using Nacos for service discovery in HertzBeat, it only connects anonymously to the default public namespace and fetches all services.
This feature request aims to add support for the following Nacos configurations:
1.Authentication (Username/Password): Allow users to specify username and password to connect to Nacos servers with authorization enabled.
2.Namespace: Allow users to specify a Nacos namespace ID to discover services within a specific isolated environment (e.g., dev, test, prod).
3.Group Name: Allow users to specify a Nacos group name to fetch services belonging to a specific group.
4.Service Name: Allow users to specify a particular service name to only discover and monitor instances of that specific service, rather than fetching all services in the registry.

Is your feature request related to a problem? Please describe

No response

Describe the solution you'd like

1.Add username, password, namespace, groupName, and serviceName fields to RegistryProtocol.
2.Update NacosDiscoveryClient to inject the username, password, and namespace properties during Nacos NamingService initialization.
3.Update the getServices() method in NacosDiscoveryClient to pass the groupName when calling getServicesOfServer() and filter the result list by serviceName.
4.Update the corresponding frontend UI to provide input fields for these new parameters.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions