# dubhe-sdk-authorization

> javascript sdk for dubhe_authorization_service, generate at 2024-01-02 16:04:57, generate by kosmos-dubhe-sdk-generator@1.2.5

Latest version **1.2.0** (published 2024-10-04) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install dubhe-sdk-authorization
pnpm add dubhe-sdk-authorization
yarn add dubhe-sdk-authorization
bun add dubhe-sdk-authorization
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2024-10-04 |
| First published | 2023-08-29 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | dalang81 |

## Links

- npm: https://www.npmjs.com/package/dubhe-sdk-authorization
- npm.io page: https://npm.io/package/dubhe-sdk-authorization

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) ^4.17.20
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.0.0
- [superagent](https://npm.io/package/superagent.md) 7.1.1
- [query-string](https://npm.io/package/query-string.md) 7.1.0

## Recent versions

- 1.2.0 (latest) — 2024-10-04
- 1.1.96 — 2023-08-29
- 1.1.95 — 2023-08-29

## README

# dubhe-sdk-authorization

dubhe-sdk-authorization - JavaScript client for
dubhe authorization service

- Package version: 1.1.99, generate by kosmos-dubhe-sdk-generator@1.2.5
- Build date: 2024-01-02 16:04:57

For more information, please visit [http://www.billion-byte.com](http://www.billion-byte.com)

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install dubhe-sdk-authorization --save
```

Finally, you need to build the module:

```shell
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:

```shell
npm install
```

Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:

```shell
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:

```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

Finally, you need to build the module:

```shell
npm run build
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript

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*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AccessControllerApi* | [**fetchAccesses**](docs/AccessControllerApi.md#fetchAccesses) | **POST** /rest/authorization/access/fetchAccesses | 获取所有权限
*AccessControllerApi* | [**fetchUserResource**](docs/AccessControllerApi.md#fetchUserResource) | **POST** /rest/authorization/access/fetchUserResource | 获取所有权限(按端)
*AccessControllerApi* | [**getAccesses**](docs/AccessControllerApi.md#getAccesses) | **POST** /rest/authorization/access/getAccesses | 获取自身所有权限
*AccessControllerApi* | [**matchAccess**](docs/AccessControllerApi.md#matchAccess) | **POST** /rest/authorization/access/match/{actionCode}/{usercode} | 验证权限
*AuthControllerApi* | [**login**](docs/AuthControllerApi.md#login) | **POST** /auth/authorization/login | 登录接口
*AuthControllerApi* | [**rDPCheck**](docs/AuthControllerApi.md#rDPCheck) | **POST** /auth/authorization/rdpCheck | RDP校验接口
*AuthControllerApi* | [**totpLogin**](docs/AuthControllerApi.md#totpLogin) | **POST** /auth/authorization/totpLogin | 登录接口
*CasControllerApi* | [**casLogin**](docs/CasControllerApi.md#casLogin) | **GET** /open/authorization/cas/casLogin/{uuid} | casLogin接口
*CasPollingControllerApi* | [**casPollingLogin**](docs/CasPollingControllerApi.md#casPollingLogin) | **POST** /open/authorization/casPolling/polling/{uuid} | casPollingLogin接口
*ChannelControllerApi* | [**fetchAllChannelByApiProductCode**](docs/ChannelControllerApi.md#fetchAllChannelByApiProductCode) | **POST** /rest/authorization/channel/fetchAllChannelByApiProductCode/{apiProductCode} | 验证渠道权限
*ChannelControllerApi* | [**fetchAllChannelByUsercode**](docs/ChannelControllerApi.md#fetchAllChannelByUsercode) | **POST** /rest/authorization/channel/fetchAllChannelByUsercode | 验证渠道权限
*ChannelControllerApi* | [**fetchChannels**](docs/ChannelControllerApi.md#fetchChannels) | **POST** /rest/authorization/channel/fetchChannels | 获取指定用户渠道权限列表信息
*ChannelControllerApi* | [**getChannels**](docs/ChannelControllerApi.md#getChannels) | **POST** /rest/authorization/channel/getChannels | 获取当前用户渠道权限列表信息
*ChannelControllerApi* | [**matchChannel**](docs/ChannelControllerApi.md#matchChannel) | **POST** /rest/authorization/channel/match/{apiProductCode} | 验证渠道权限
*DiscoveryControllerApi* | [**allApplication**](docs/DiscoveryControllerApi.md#allApplication) | **GET** /rest/authorization/discovery/allApplication | allApplication
*DiscoveryControllerApi* | [**discoveryService**](docs/DiscoveryControllerApi.md#discoveryService) | **GET** /rest/authorization/discovery/discoveryService/{serviceName} | discoveryService
*MockCacheControllerApi* | [**doMockCache**](docs/MockCacheControllerApi.md#doMockCache) | **GET** /rest/authorization/mockCache/doMockCache | doMockCache
*PingControllerApi* | [**systemPing**](docs/PingControllerApi.md#systemPing) | **GET** /open/authorization/ping/ping/ping | systemPing
*ProductControllerApi* | [**fetchProducts**](docs/ProductControllerApi.md#fetchProducts) | **POST** /rest/authorization/product/fetchProducts | 获取指定用户产品树权限列表信息
*ProductControllerApi* | [**getProducts**](docs/ProductControllerApi.md#getProducts) | **POST** /rest/authorization/product/getProducts | 获取指定用户产品树权限列表信息
*ProductControllerApi* | [**matchProduct**](docs/ProductControllerApi.md#matchProduct) | **POST** /rest/authorization/product/match/{usercode} | 验证产品树权限
*ProjectControllerApi* | [**fetchDmProjects**](docs/ProjectControllerApi.md#fetchDmProjects) | **POST** /rest/authorization/project/fetchDmAllProject | 获取指定用户数据管控项目权限列表信息
*ProjectControllerApi* | [**fetchProjects**](docs/ProjectControllerApi.md#fetchProjects) | **POST** /rest/authorization/project/fetchProjects | 获取指定用户项目权限列表信息
*ProjectControllerApi* | [**getDmProjects**](docs/ProjectControllerApi.md#getDmProjects) | **POST** /rest/authorization/project/getDmProjects | 获取当前用户项目权限列表信息
*ProjectControllerApi* | [**getProjects**](docs/ProjectControllerApi.md#getProjects) | **POST** /rest/authorization/project/getProjects | 获取当前用户项目权限列表信息
*ProjectControllerApi* | [**matchDmProject**](docs/ProjectControllerApi.md#matchDmProject) | **POST** /rest/authorization/project/matchDmProject/{usercode} | 验证项目权限
*ProjectControllerApi* | [**matchProject**](docs/ProjectControllerApi.md#matchProject) | **POST** /rest/authorization/project/match/{usercode} | 验证项目权限
*RdpControllerApi* | [**validateRdp**](docs/RdpControllerApi.md#validateRdp) | **POST** /rest/authorization/rdp/validateRdp | RDP校验接口
*RdpControllerApi* | [**validateRdpUserCode**](docs/RdpControllerApi.md#validateRdpUserCode) | **PUT** /rest/authorization/rdp/validateRdp | RDP校验接口按用户(端对端)
*ReportControllerApi* | [**fetchReports**](docs/ReportControllerApi.md#fetchReports) | **POST** /rest/authorization/report/fetchReports | 获取指定用户产品树权限列表信息
*ServiceOfflineControllerApi* | [**fireOffline**](docs/ServiceOfflineControllerApi.md#fireOffline) | **DELETE** /rest/authorization/serviceOffline/fireOffline | fireOffline
*Sm2CryptoControllerApi* | [**decryptBySm2**](docs/Sm2CryptoControllerApi.md#decryptBySm2) | **POST** /rest/authorization/sm2/crypto/decrypt | 在线解密
*Sm2CryptoControllerApi* | [**encryptBySm2**](docs/Sm2CryptoControllerApi.md#encryptBySm2) | **POST** /rest/authorization/sm2/crypto/encrypt | 在线加密
*Sm2CryptoControllerApi* | [**getSm2CryptoPublicKey**](docs/Sm2CryptoControllerApi.md#getSm2CryptoPublicKey) | **GET** /rest/authorization/sm2/crypto/getPublicKey | 获取加密公钥
*SuControllerApi* | [**apiKeyLogin**](docs/SuControllerApi.md#apiKeyLogin) | **POST** /rest/authorization/su/apiKeyLogin | apiKeyLogin接口
*SuControllerApi* | [**matchApiKeyRemoteIp**](docs/SuControllerApi.md#matchApiKeyRemoteIp) | **POST** /rest/authorization/su/matchApiKeyRemoteIp | matchApiKeyRemoteIp接口
*SuControllerApi* | [**sudoLogin**](docs/SuControllerApi.md#sudoLogin) | **POST** /rest/authorization/su/sudoLogin | sudoLogin接口
*SuControllerApi* | [**wxLogin**](docs/SuControllerApi.md#wxLogin) | **POST** /rest/authorization/su/wxLogin | wxLogin接口
*SuControllerApi* | [**wxLoginByIdNo**](docs/SuControllerApi.md#wxLoginByIdNo) | **POST** /rest/authorization/su/wxLoginByIdNo | idNo接口
*SystemCacheControllerApi* | [**systemCacheClearAll**](docs/SystemCacheControllerApi.md#systemCacheClearAll) | **POST** /rest/authorization/systemCache/clearAll | 清理L2CACHE全部缓存
*SystemCacheControllerApi* | [**systemCacheClearMulti**](docs/SystemCacheControllerApi.md#systemCacheClearMulti) | **POST** /rest/authorization/systemCache/clearMulti | 清理L2CACHE缓存
*SystemCacheControllerApi* | [**systemCacheList**](docs/SystemCacheControllerApi.md#systemCacheList) | **GET** /rest/authorization/systemCache/list | list
*TokenControllerApi* | [**refreshTokenUsingPOST**](docs/TokenControllerApi.md#refreshTokenUsingPOST) | **POST** /rest/authorization/token/refresh | 换取TOKEN接口
*TotpControllerApi* | [**getQrOrNullSave**](docs/TotpControllerApi.md#getQrOrNullSave) | **POST** /rest/authorization/totp/getQrOrNullSave/{userCode} | 获取,若空则生成totpQR
*TotpControllerApi* | [**getTotpQr**](docs/TotpControllerApi.md#getTotpQr) | **POST** /rest/authorization/totp/getQr | 获取totpQR
*TotpControllerApi* | [**replace**](docs/TotpControllerApi.md#replace) | **POST** /rest/authorization/totp/replaceByUserCode/{userCode} | 替换新totpQR
*TotpControllerApi* | [**replaceQR**](docs/TotpControllerApi.md#replaceQR) | **POST** /rest/authorization/totp/replaceQR | 获取新totpQR
*TotpControllerApi* | [**replaceSaveByUserCode**](docs/TotpControllerApi.md#replaceSaveByUserCode) | **POST** /rest/authorization/totp/replaceSaveByUserCode/{userCode} | 替换验证并保存
*TotpControllerApi* | [**validateByUserCode**](docs/TotpControllerApi.md#validateByUserCode) | **POST** /rest/authorization/totp/validateByUserCode/{userCode} | 验证
*TotpControllerApi* | [**validateTotp**](docs/TotpControllerApi.md#validateTotp) | **POST** /rest/authorization/totp/validate/{correctCode} | 验证
*TotpControllerApi* | [**validateTotpAndSave**](docs/TotpControllerApi.md#validateTotpAndSave) | **POST** /rest/authorization/totp/validateTotpAndSave | 验证并保存
*UserAuthControllerApi* | [**currentUserDetail**](docs/UserAuthControllerApi.md#currentUserDetail) | **POST** /rest/authorization/userauth/currentUserDetail | currentUserDetail
*UserAuthControllerApi* | [**currentUserDetailByApiKey**](docs/UserAuthControllerApi.md#currentUserDetailByApiKey) | **POST** /rest/authorization/userauth/currentUserDetailByApiKey | currentUserDetailByApiKey
*UserAuthControllerApi* | [**currentUserDetailByIdNo**](docs/UserAuthControllerApi.md#currentUserDetailByIdNo) | **POST** /rest/authorization/userauth/currentUserDetailByIdNo | currentUserDetailByIdNo
*UserAuthControllerApi* | [**currentUserDetailByIdNoAllStatus**](docs/UserAuthControllerApi.md#currentUserDetailByIdNoAllStatus) | **POST** /rest/authorization/userauth/currentUserDetailByIdNoAllStatus | currentUserDetailByIdNoAllStatus
*UserAuthControllerApi* | [**currentUserDetailByOpenId**](docs/UserAuthControllerApi.md#currentUserDetailByOpenId) | **POST** /rest/authorization/userauth/currentUserDetailByOpenId | currentUserDetailByOpenId
*UserAuthControllerApi* | [**currentUserDetailByTotp**](docs/UserAuthControllerApi.md#currentUserDetailByTotp) | **POST** /rest/authorization/userauth/currentUserDetailByTotp | currentUserDetailByTotp
*UserControllerApi* | [**current**](docs/UserControllerApi.md#current) | **POST** /rest/authorization/user/current | 获取当前用户信息
*UserControllerApi* | [**detail**](docs/UserControllerApi.md#detail) | **POST** /rest/authorization/user/detail | 获取当前用户详细信息


## Models

 - [AuthResponse](docs/AuthResponse.md)
 - [CacheStatsWraper](docs/CacheStatsWraper.md)
 - [GrantedAuthority](docs/GrantedAuthority.md)
 - [IUser](docs/IUser.md)
 - [SysGroupResource](docs/SysGroupResource.md)
 - [TotpQrBean](docs/TotpQrBean.md)
 - [ViewUser](docs/ViewUser.md)

---
_Source: https://npm.io/package/dubhe-sdk-authorization · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
