1.1.96 • Published 9 months ago

dubhe-sdk-authorization v1.1.96

Weekly downloads
-
License
Unlicense
Repository
-
Last release
9 months ago

dubhe-sdk-authorization

dubhe-sdk-authorization - JavaScript client for dubhe authorization service

  • Package version: 1.1.95
  • Build date: 2023-07-21 21:34:28

For more information, please visit http://www.billion-byte.com

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install dubhe-sdk-authorization --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your dubhe-sdk-authorization from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

Getting Started

Please follow the installation instruction and execute the following JS code:

import { AccessControllerApi } from 'dubhe-sdk-authorization';

const api = new AccessControllerApi(ApiContext.getInstance());
const usercode = "usercode_example"; // {String} 用户名
try {
  const {data} = await api.fetchAccesses(usercode);
} catch(error) {
  console.error(error);
}

API Endpoints

All URIs are relative to http://91.2.3.65:28790/AUTHORIZATION

ClassMethodHTTP requestDescription
AccessControllerApifetchAccessesPOST /rest/authorization/access/fetchAccesses获取所有权限
AccessControllerApifetchUserResourcePOST /rest/authorization/access/fetchUserResource获取所有权限(按端)
AccessControllerApigetAccessesPOST /rest/authorization/access/getAccesses获取自身所有权限
AccessControllerApimatchAccessPOST /rest/authorization/access/match/{actionCode}/{usercode}验证权限
AuthControllerApiloginPOST /auth/authorization/login登录接口
AuthControllerApirDPCheckPOST /auth/authorization/rdpCheckRDP校验接口
AuthControllerApitotpLoginPOST /auth/authorization/totpLogin登录接口
CasControllerApicasLoginGET /open/authorization/cas/casLogin/{uuid}casLogin接口
CasPollingControllerApicasPollingLoginPOST /open/authorization/casPolling/polling/{uuid}casPollingLogin接口
ChannelControllerApifetchAllChannelByApiProductCodePOST /rest/authorization/channel/fetchAllChannelByApiProductCode/{apiProductCode}验证渠道权限
ChannelControllerApifetchAllChannelByUsercodePOST /rest/authorization/channel/fetchAllChannelByUsercode验证渠道权限
ChannelControllerApifetchChannelsPOST /rest/authorization/channel/fetchChannels获取指定用户渠道权限列表信息
ChannelControllerApigetChannelsPOST /rest/authorization/channel/getChannels获取当前用户渠道权限列表信息
ChannelControllerApimatchChannelPOST /rest/authorization/channel/match/{apiProductCode}验证渠道权限
DiscoveryControllerApiallApplicationGET /rest/authorization/discovery/allApplicationallApplication
DiscoveryControllerApidiscoveryServiceGET /rest/authorization/discovery/discoveryService/{serviceName}discoveryService
MockCacheControllerApidoMockCacheGET /rest/authorization/mockCache/doMockCachedoMockCache
PingControllerApisystemPingGET /open/authorization/ping/ping/pingsystemPing
ProductControllerApifetchProductsPOST /rest/authorization/product/fetchProducts获取指定用户产品树权限列表信息
ProductControllerApigetProductsPOST /rest/authorization/product/getProducts获取指定用户产品树权限列表信息
ProductControllerApimatchProductPOST /rest/authorization/product/match/{usercode}验证产品树权限
ProjectControllerApifetchDmProjectsPOST /rest/authorization/project/fetchDmAllProject获取指定用户数据管控项目权限列表信息
ProjectControllerApifetchProjectsPOST /rest/authorization/project/fetchProjects获取指定用户项目权限列表信息
ProjectControllerApigetDmProjectsPOST /rest/authorization/project/getDmProjects获取当前用户项目权限列表信息
ProjectControllerApigetProjectsPOST /rest/authorization/project/getProjects获取当前用户项目权限列表信息
ProjectControllerApimatchDmProjectPOST /rest/authorization/project/matchDmProject/{usercode}验证项目权限
ProjectControllerApimatchProjectPOST /rest/authorization/project/match/{usercode}验证项目权限
RdpControllerApivalidateRdpPOST /rest/authorization/rdp/validateRdpRDP校验接口
RdpControllerApivalidateRdpUserCodePUT /rest/authorization/rdp/validateRdpRDP校验接口按用户(端对端)
ReportControllerApifetchReportsPOST /rest/authorization/report/fetchReports获取指定用户产品树权限列表信息
ServiceOfflineControllerApifireOfflineDELETE /rest/authorization/serviceOffline/fireOfflinefireOffline
Sm2CryptoControllerApidecryptBySm2POST /rest/authorization/sm2/crypto/decrypt在线解密
Sm2CryptoControllerApiencryptBySm2POST /rest/authorization/sm2/crypto/encrypt在线加密
Sm2CryptoControllerApigetSm2CryptoPublicKeyGET /rest/authorization/sm2/crypto/getPublicKey获取加密公钥
SuControllerApiapiKeyLoginPOST /rest/authorization/su/apiKeyLoginapiKeyLogin接口
SuControllerApisudoLoginPOST /rest/authorization/su/sudoLoginsudoLogin接口
SuControllerApiwxLoginPOST /rest/authorization/su/wxLoginwxLogin接口
SuControllerApiwxLoginByIdNoPOST /rest/authorization/su/wxLoginByIdNoidNo接口
SystemCacheControllerApisystemCacheClearAllPOST /rest/authorization/systemCache/clearAll清理L2CACHE全部缓存
SystemCacheControllerApisystemCacheClearMultiPOST /rest/authorization/systemCache/clearMulti清理L2CACHE缓存
SystemCacheControllerApisystemCacheListGET /rest/authorization/systemCache/listlist
TokenControllerApirefreshTokenUsingPOSTPOST /rest/authorization/token/refresh换取TOKEN接口
TotpControllerApigetQrOrNullSavePOST /rest/authorization/totp/getQrOrNullSave/{userCode}获取,若空则生成totpQR
TotpControllerApigetTotpQrPOST /rest/authorization/totp/getQr获取totpQR
TotpControllerApireplacePOST /rest/authorization/totp/replaceByUserCode/{userCode}替换新totpQR
TotpControllerApireplaceQRPOST /rest/authorization/totp/replaceQR获取新totpQR
TotpControllerApireplaceSaveByUserCodePOST /rest/authorization/totp/replaceSaveByUserCode/{userCode}替换验证并保存
TotpControllerApivalidateByUserCodePOST /rest/authorization/totp/validateByUserCode/{userCode}验证
TotpControllerApivalidateTotpPOST /rest/authorization/totp/validate/{correctCode}验证
TotpControllerApivalidateTotpAndSavePOST /rest/authorization/totp/validateTotpAndSave验证并保存
UserAuthControllerApicurrentUserDetailPOST /rest/authorization/userauth/currentUserDetailcurrentUserDetail
UserAuthControllerApicurrentUserDetailByApiKeyPOST /rest/authorization/userauth/currentUserDetailByApiKeycurrentUserDetailByApiKey
UserAuthControllerApicurrentUserDetailByIdNoPOST /rest/authorization/userauth/currentUserDetailByIdNocurrentUserDetailByIdNo
UserAuthControllerApicurrentUserDetailByIdNoAllStatusPOST /rest/authorization/userauth/currentUserDetailByIdNoAllStatuscurrentUserDetailByIdNoAllStatus
UserAuthControllerApicurrentUserDetailByOpenIdPOST /rest/authorization/userauth/currentUserDetailByOpenIdcurrentUserDetailByOpenId
UserAuthControllerApicurrentUserDetailByTotpPOST /rest/authorization/userauth/currentUserDetailByTotpcurrentUserDetailByTotp
UserControllerApicurrentPOST /rest/authorization/user/current获取当前用户信息
UserControllerApidetailPOST /rest/authorization/user/detail获取当前用户详细信息

Models

1.1.96

9 months ago

1.1.95

9 months ago