Password-Free

In some scenarios, in order to facilitate development and debugging, and to access pages and interfaces conveniently, you can enable test mode configuration for secret-free authentication

Control through unified authentication processing filter: org.apache.linkis.server.security.SecurityFilter

configuration item

  1. # Whether to enable test mode
  2. wds.linkis.test.mode=true
  3. # Simulated user name for test mode
  4. wds.linkis.test.user=hadoop

Implemented pseudocode

  1. val BDP_TEST_USER = CommonVars("wds.linkis.test.user", "")
  2. val IS_TEST_MODE = CommonVars("wds. linkis. test. mode", false)
  3. if (IS_TEST_MODE. getValue) {
  4. logger.info("test mode! login for uri: " + request.getRequestURI)
  5. // Set the login user information to the user specified in the configuration
  6. SecurityFilter.setLoginUser(response, BDP_TEST_USER)
  7. true
  8. }

Directly modify the configuration file linkis.properties (effective for all linkis services), modify the corresponding configuration as follows

  1. # Whether to enable test mode
  2. wds.linkis.test.mode=true
  3. # Simulated user name for test mode
  4. wds.linkis.test.user=hadoop

If you only need to enable the test mode of a certain service, you can modify the corresponding service configuration item. For example: only enable the test mode of entrance service Directly modify the configuration file linkis-cg-entrance.properties (effective for the entry service of linkis), modify the corresponding configuration as follows

  1. # Whether to enable test mode
  2. wds.linkis.test.mode=true
  3. # Simulated user name for test mode
  4. wds.linkis.test.user=hadoop

After modifying the configuration, you need to restart the service to take effect

After successfully restarting the service, you can directly request the http interface that originally required authentication, and you can request normally without additional authentication. The management console can also access the content page without login authentication

Because some interfaces will perform permission verification of user roles, such as: [Search historical EC information] interface: /api/rest_j/v1/linkisManager/ecinfo/ecrHistoryList The roles are:

role namepermission descriptionconfiguration itemdefault value
Administrator roleThe highest authority, has all authority operationswds.linkis.governance.station.adminhadoop
Historical task roleCompared with ordinary users, you can also view all task list information of other userswds.linkis.jobhistory.adminhadoop
Normal roleDefault role

For tests in different scenarios, the set value of wds.linkis.test.user will be different and needs to be set according to the actual scenario. If you need to access all interfaces, you need to configure it to the same value as wds.linkis.governance.station.admin, usually hadoop