Skip to main content

Policy Management

Note

Requests for v3 edition have been aligned with HTTP API. When calling Serverless Cloud Function (SCF), cloud hosting, or cloud storage, HTTP API enforces strict permission management. Therefore, prior to using v3 version SDK, please confirm whether policy management meets expectations.

The following uses Serverless Cloud Function (SCF) as an example to introduce how to configure a policy in detail.

Enter the control page for permission

  1. From the Cloud Development Platform/Identity Verification/Permission Control menu, click Permission Control to enter the page.
  1. On the Permission Control webpage, click the Configure Permissions menu for the corresponding role to see the related open API policies in the policy list. If there is no corresponding open API policy, click Create Custom Policy to proceed.

Policy Configuration

Click the Create Custom Policy operation for a role to perform role association configuration, select gateway as the resource type in the pop-up, and click Next.

Select the corresponding open API in the list to configure policy. The mapping relationship of policy identifier is as follows:

-StoragesHttpApiAllow => cloud storage -FunctionsHttpApiAllow => SCF -CloudrunHttpApiAllow => cloud hosting

Note

After confirming the role association, it will take effect in 3 minutes.

Policy verification

Assuming that the associated role of FunctionsHttpApiAllow is set to include default guest , i.e. anonymous users can call cloud functions, the cloud function call result will be returned successfully when the following operations are performed:

// Initialize it.
const app = cloudbase.init({
env: "your-env-id", // Replace this value with your environment ID
});

Anonymous user logged in as default visitor.
await app.auth.signInAnonymously();

Call the SCF named test
await app.callFunction({ name: "test" });

Return 200 OK