# 安全接口调用说明
# 获取Token
# 操作
- 使用admin账号登录系统,在右上角找到token管理,并增加一个token认证。
- 最后复制密钥。得到token。
# 查看所有加密类型
# 请求详情
URL:
http://127.0.0.1:10010/api/desensitization/external/getDesensitizations
请求方式:
GET
请求头:
Authorization: [您在步骤0获取的Token]
请求参数(无):
响应实例:
//注意encryptParams 为加密是参数格式,name为加密类型,decryptParams为解密参数格式 [ { "encryptParams": { "value": "原始值" }, "name": "RSA", "decryptParams": { "args": { "authId": "通过加密接口获取的authId" }, "value": "加密后的值" } }, { "encryptParams": { "value": "原始值" }, "name": "3DES", "decryptParams": { "args": { "authId": "通过加密接口获取的authId" }, "value": "加密后的值" } }, { "encryptParams": { "value": "原始值" }, "name": "AES", "decryptParams": { "args": { "authId": "通过加密接口获取的authId" }, "value": "加密后的值" } }, { "encryptParams": { "value": "原始值" }, "name": "DES", "decryptParams": { "args": { "authId": "通过加密接口获取的authId" }, "value": "加密后的值" } }, { "encryptParams": { "value": "原始值" }, "name": "BASE64", "decryptParams": { "args": { "authId": "通过加密接口获取的authId" }, "value": "加密后的值" } }, { "encryptParams": { "value": "原始值" }, "name": "SM4", "decryptParams": { "args": { "authId": "通过加密接口获取的authId" }, "value": "加密后的值" } } ]
# 查看所有脱敏方式
# 请求详情
URL:
http://127.0.0.1:10010/api/algorithms/external/getAlgorithms
请求方式:
GET
请求头:
Authorization: [您在步骤0获取的Token]
请求参数(无):
响应实例:
//parseParams 为脱敏参数格式,name为脱敏类型,description为中文注释 [ { "name": "ChinaLicensePlateNumber", "description": "中国车牌号脱敏", "parseParams": { "value": "真实车牌号" } }, { "name": "ChinaSocialCreditIdentifier", "description": "中国社会信用代码脱敏", "parseParams": { "value": "真实社会信用代码" } }, { "name": "Pattern", "description": "正则表达式脱敏", "parseParams": { "args": { "pattern": "正则表达式例:\\d{6}(\\d{8})\\d{4}", "placeholder": "替换的占位符例: ****** " }, "value": "真实数据" } }, { "name": "Email", "description": "电子邮件地址脱敏", "parseParams": { "value": "真实电子邮件地址" } }, { "name": "ChinaMobilePhoneNumber", "description": "中国境内移动电话号码脱敏", "parseParams": { "value": "真实手机号码" } }, { "name": "ChinaTelNumber", "description": "中国固定电话号码脱敏", "parseParams": { "value": "真实电话号码:021-12345678" } }, { "name": "Average", "description": "平均值脱敏", "parseParams": { "value": "真实数据" } }, { "name": "Date", "description": "日期脱敏", "parseParams": { "value": "真实日期" } }, { "name": "FixedLength", "description": "定长数据脱敏", "parseParams": { "args": { "snippets": "脱敏片段从0开始,例18位的身份证号示例:8-14,16-18", "length": "定长数据的长度,如国内18位的身份证号例:18" }, "value": "真实数据" } }, { "name": "ChinaResidentIDCard", "description": "中国居民身份证号码脱敏", "parseParams": { "value": "真实身份证号码" } }, { "name": "FullName", "description": "姓名脱敏", "parseParams": { "args": { "hiddenLastName": "隐藏名字例:true / false", "hiddenFamilyName": "隐藏姓氏例:true / false" }, "value": "真实姓名" } }, { "name": "Invalidate", "description": "无效化脱敏", "parseParams": { "value": "真实数据" } }, { "name": "ChinaBankCardNumber", "description": "中国银行卡号脱敏", "parseParams": { "value": "真实银行卡号" } }, { "name": "Deviation", "description": "偏移脱敏", "parseParams": { "value": "真实数据" } }, { "name": "SimpleAddress", "description": "地址脱敏", "parseParams": { "value": "真实地址" } } ]
# 加密接口
# 请求详情
- URL:
http://127.0.0.1:10010/api/desensitization/external/encrypt/{name}
- 请求方式:
POST
- 请求头:
Authorization: [您在步骤0获取的Token]
- 请求参数(Body):
{ "value": "需要加密的字符串" }
- 响应实例:
{ "value": "经过加密逻辑后的字符串", "args": { "authId": "3c15a9b429c34743ae8df625a4580ef3" } }
# 解密接口
# 请求详情
- URL:
http://127.0.0.1:10010/api/desensitization/external/decrypt
- 请求方式:
POST
- 请求头:
Authorization: [您在步骤0获取的Token]
- 请求参数(Body):
{ "value": "经过加密逻辑后的字符串", "args": { "authId": "3c15a9b429c34743ae8df625a4580ef3" //加密产生的 } }
- 响应实例:
{ "value": "经过解密逻辑后的字符串" }
# 脱敏接口
# 请求详情
- URL:
http://127.0.0.1:10010/api/algorithms/external/parse/{name}
- 请求方式:
POST
- 请求头:
Authorization: [您在步骤0获取的Token]
- 请求参数(Body):
{ "value": "15588888888" }
- 响应实例:
{ "value": "155****888" }
# 注意事项
- 上述文档中的URL和Token需要根据您实际获取的Token进行替换。
- ip端口为服务引擎地址(data-service-engine)。