All Products
Search
Document Center

Edit Authentication Rule

Last Updated: Aug 17, 2020

This topic describes how to create and enable an access control rule for a service.

Procedure

  1. Log on to the SOFAStack MS Platform console, choose Microservices > Service management.
  2. On the page that appears, enter the target app or service name in the search bar and click the search icon. In the list of services found, click the target service ID.
  3. On the service details page that appears, click the Service governance tab.
  4. Select an access control mode.

    • Whitelist: Only service access requests that meet the whitelist rules are allowed. All other requests are rejected.
    • Blacklist: Service access requests that meet the blacklist rules are rejected. All other requests are allowed.
  5. Click Add rule. Enter a rule name, which can contain Chinese characters, letters, digits, and underscores (_).

  6. Edit the match conditions. The procedure is as follows:

    1. Select the field type and field name.

      • System field: The following fields are provided: app name of the caller, IP address of the caller, app name of the service provider, service name of the service provider, and method name of the service provider.
      • Custom field: You can customize fields based on your needs.
    2. Specify the logical relationships.

      • Equals
      • Does Not Equal
      • Is Part Of
      • Is Not Part Of
      • Regular expression: You can configure a regular expression to match requests.
      1. Enter the field value to be matched.
  7. Click Save.
  8. Click Enable.