Categorygithub.com/Macrow/ucs-go-sdk
repositorypackage
1.3.1
Repository: https://github.com/macrow/ucs-go-sdk.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

ucs-go-sdk

build Go Reference

用于集成ucs的开发包

快速开始

安装

go get -u github.com/Macrow/ucs-go-sdk

验证Jwt

validator := NewValidator(rsaPublicKey)
jwtUser, err := validator.ValidateJwt(token)

创建连接UCS的客户端

client := NewRpcClient("your.domain.com:port") // Rpc客户端
// client := NewTLSRpcClient(certFile, "your.domain.com:port") // TLS连接下的Rpc客户端,需要UCS服务也同时开启
// client := NewHttpClient("https://your.domain.com:port", yourAccessCode) // Http客户端
client.SetToken(token)

UCS服务端验证Jwt

err := client.ValidateJwt()

UCS服务端验证操作码

err := client.ValidatePermOperationByCode("UCS_O_CODE")

UCS服务端验证接口

err := client.ValidatePermAction("ucs", "/api/v1/ucs/users", "get")

UCS服务端验证用户是否拥有机构权限

err := client.ValidatePermOrgById("org_id_is_here")