Skip to content

Latest commit

 

History

History
278 lines (192 loc) · 5.98 KB

File metadata and controls

278 lines (192 loc) · 5.98 KB

ILLA Supervisor Backend AccessControl APIs

Desc

Those APIs design for authorization token verification.

Note that all requests require a RequestToken field in the request header, generated from the other fields in the request + the internal rotor_token MD5.

Index

Consts

const UNIT_TYPE_TEAM        = 1 // cloud team
const UNIT_TYPE_TEAM_MEMBER = 2 // cloud team member
const UNIT_TYPE_USER        = 3 // cloud user
const UNIT_TYPE_INVITE      = 4 // cloud invite
const UNIT_TYPE_DOMAIN      = 5 // cloud domain
const UNIT_TYPE_BILLING     = 6 // cloud billing
const UNIT_TYPE_APP         = 7 // builder app
const UNIT_TYPE_COMPONENTS  = 8 // builder components
const UNIT_TYPE_RESOURCE    = 9 // resource resource
const UNIT_TYPE_ACTION      = 10 // resource action
const UNIT_TYPE_TRANSFORMER = 11 // resource transformer
const UNIT_TYPE_JOB         = 12 // hub job

Validate User Account

Desc

Check if the current user is legal.

API Endpoint

GET  /api/v1/accessControl/account/validateResult

Request Header

Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoxNiwidXVpZCI6IjdlNzY0ZDBlLWM4NjAtNDNjMS04ZThjLWUwMGRkMzEyNTExMyIsInJuZCI6IjAwMDI5OSIsImlzcyI6IklMTEEiLCJleHAiOjE2NzM5NDI5Nzh9.bVAtUusjnZSipfquPKmKileXJbFfl1XoLJbRSQ-Mk2c"
RequestToken: bash64(md5(sort($Authorization)))

Request Body

// none

Response

// HTTP 200
// or
// HTTP 400

Can Access

Desc

Whether the current user can have access to the resource.

API Endpoint

GET  /api/v1/accessControl/team/:teamID/unitType/:unitType/unitID/:unitID/attribute/canAccess/:attributeID

Request Header

Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoxNiwidXVpZCI6IjdlNzY0ZDBlLWM4NjAtNDNjMS04ZThjLWUwMGRkMzEyNTExMyIsInJuZCI6IjAwMDI5OSIsImlzcyI6IklMTEEiLCJleHAiOjE2NzM5NDI5Nzh9.bVAtUusjnZSipfquPKmKileXJbFfl1XoLJbRSQ-Mk2c"
RequestToken: bash64(md5(sort($Authorization+$teamID+$unitType+$unitID+$attributeID)))

Request Body

// none

Response

// HTTP 200
// or
// HTTP 400

Can Manage

Desc

Whether the current user can manage the resource

API Endpoint

GET  /api/v1/accessControl/team/:teamID/unitType/:unitType/unitID/:unitID/attribute/canManage/:attributeID

Request Header

Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoxNiwidXVpZCI6IjdlNzY0ZDBlLWM4NjAtNDNjMS04ZThjLWUwMGRkMzEyNTExMyIsInJuZCI6IjAwMDI5OSIsImlzcyI6IklMTEEiLCJleHAiOjE2NzM5NDI5Nzh9.bVAtUusjnZSipfquPKmKileXJbFfl1XoLJbRSQ-Mk2c"
RequestToken: bash64(md5(sort($Authorization+$teamID+$unitType+$unitID+$attributeID)))

Request Body

// none

Response

// HTTP 200
// or
// HTTP 400

Can ManageSpecial

Desc

Whether the current user can manage special attributes of the current resource.

API Endpoint

GET  /api/v1/accessControl/team/:teamID/unitType/:unitType/unitID/:unitID/attribute/canManageSpecial/:attributeID

Request Header

Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoxNiwidXVpZCI6IjdlNzY0ZDBlLWM4NjAtNDNjMS04ZThjLWUwMGRkMzEyNTExMyIsInJuZCI6IjAwMDI5OSIsImlzcyI6IklMTEEiLCJleHAiOjE2NzM5NDI5Nzh9.bVAtUusjnZSipfquPKmKileXJbFfl1XoLJbRSQ-Mk2c"
RequestToken: bash64(md5(sort($Authorization+$teamID+$unitType+$unitID+$attributeID)))

Request Body

// none

Response

// HTTP 200
// or
// HTTP 400

Can Modify

Desc

Whether the current user can modify the resource.

API Endpoint

GET  /api/v1/accessControl/team/:teamID/unitType/:unitType/unitID/:unitID/attribute/canModify/:attributeID/from/:fromID/to/:toID

Request Header

Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoxNiwidXVpZCI6IjdlNzY0ZDBlLWM4NjAtNDNjMS04ZThjLWUwMGRkMzEyNTExMyIsInJuZCI6IjAwMDI5OSIsImlzcyI6IklMTEEiLCJleHAiOjE2NzM5NDI5Nzh9.bVAtUusjnZSipfquPKmKileXJbFfl1XoLJbRSQ-Mk2c"
RequestToken: bash64(md5(sort($Authorization+$teamID+$unitType+$unitID+$attributeID+$from+$to)))

Request Body

// none

Response

// HTTP 200
// or
// HTTP 400

Can Delete

Desc

Whether the current user can delete the resource.

API Endpoint

GET  /api/v1/accessControl/team/:teamID/unitType/:unitType/unitID/:unitID/attribute/canDelete/:attributeID

Request Header

Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoxNiwidXVpZCI6IjdlNzY0ZDBlLWM4NjAtNDNjMS04ZThjLWUwMGRkMzEyNTExMyIsInJuZCI6IjAwMDI5OSIsImlzcyI6IklMTEEiLCJleHAiOjE2NzM5NDI5Nzh9.bVAtUusjnZSipfquPKmKileXJbFfl1XoLJbRSQ-Mk2c"
RequestToken: bash64(md5(sort($Authorization+$teamID+$unitType+$unitID+$attributeID)))

Request Body

// none

Response

// HTTP 200
// or
// HTTP 400