Documentation
¶
Index ¶
- Constants
- type Client
- type CommonPermitResult
- type HttpClient
- func (c *HttpClient) SetHttpHeaderNames(accessCodeHeader, randomKeyHeader string) Client
- func (c *HttpClient) SetTimeout(timeout int) Client
- func (c *HttpClient) SetToken(token string) Client
- func (c *HttpClient) ValidateJwt() error
- func (c *HttpClient) ValidatePermAction(service, path, method string) error
- func (c *HttpClient) ValidatePermOperationByCode(operationCode string) error
- func (c *HttpClient) ValidatePermOrgById(orgId string) error
- type JwtUser
- type NormalHttpResponse
- type PermitHttpResponse
- type RpcClient
- func (c *RpcClient) SetHttpHeaderNames(accessCodeHeader, randomKeyHeader string) Client
- func (c *RpcClient) SetTimeout(timeout int) Client
- func (c *RpcClient) SetToken(token string) Client
- func (c *RpcClient) ValidateJwt() error
- func (c *RpcClient) ValidatePermAction(service, path, method string) error
- func (c *RpcClient) ValidatePermOperationByCode(operationCode string) error
- func (c *RpcClient) ValidatePermOrgById(orgId string) error
- type Validator
Constants ¶
View Source
const ( DefaultHeaderRandomKey = "Random-Key" DefaultHeaderAccessCode = "Access-Code" DefaultNoPermMsg = "权限不足" DefaultTimeout = 3 ValidateJwtURL = "/api/v1/ucs/current/blank" ValidatePermOperationByCodeURL = "/api/v1/ucs/current/check-operation" ValidatePermActionURL = "/api/v1/ucs/current/check-action" ValidatePermOrgByIdURL = "/api/v1/ucs/current/check-org" )
View Source
const ( JwtTokenClaimsId = "id" JwtTokenClaimsName = "name" JwtTokenClaimsDeviceId = "did" JwtTokenClaimsIssuer = "iss" JwtTokenClaimsIssueAt = "iat" JwtTokenClaimsExpireAt = "exp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { SetTimeout(timeout int) Client SetToken(token string) Client SetHttpHeaderNames(accessCodeHeader, randomKeyHeader string) Client ValidateJwt() error ValidatePermOperationByCode(operationCode string) error ValidatePermAction(service, path, method string) error ValidatePermOrgById(orgId string) error }
func NewHttpClient ¶ added in v1.1.0
func NewRpcClient ¶ added in v1.1.0
type CommonPermitResult ¶ added in v1.1.0
type CommonPermitResult struct {
Permit bool `json:"permit"`
}
type HttpClient ¶ added in v1.1.0
type HttpClient struct {
// contains filtered or unexported fields
}
func (*HttpClient) SetHttpHeaderNames ¶ added in v1.1.0
func (c *HttpClient) SetHttpHeaderNames(accessCodeHeader, randomKeyHeader string) Client
func (*HttpClient) SetTimeout ¶ added in v1.1.0
func (c *HttpClient) SetTimeout(timeout int) Client
func (*HttpClient) SetToken ¶ added in v1.1.0
func (c *HttpClient) SetToken(token string) Client
func (*HttpClient) ValidateJwt ¶ added in v1.1.0
func (c *HttpClient) ValidateJwt() error
func (*HttpClient) ValidatePermAction ¶ added in v1.1.0
func (c *HttpClient) ValidatePermAction(service, path, method string) error
func (*HttpClient) ValidatePermOperationByCode ¶ added in v1.1.0
func (c *HttpClient) ValidatePermOperationByCode(operationCode string) error
func (*HttpClient) ValidatePermOrgById ¶ added in v1.1.0
func (c *HttpClient) ValidatePermOrgById(orgId string) error
type JwtUser ¶
type NormalHttpResponse ¶ added in v1.1.0
type PermitHttpResponse ¶ added in v1.1.0
type PermitHttpResponse struct { Code int `json:"code"` Message string `json:"message"` Result CommonPermitResult `json:"result"` }
type RpcClient ¶ added in v1.1.0
type RpcClient struct {
// contains filtered or unexported fields
}
func (*RpcClient) SetHttpHeaderNames ¶ added in v1.1.0
func (*RpcClient) SetTimeout ¶ added in v1.1.0
func (*RpcClient) ValidateJwt ¶ added in v1.1.0
func (*RpcClient) ValidatePermAction ¶ added in v1.1.0
func (*RpcClient) ValidatePermOperationByCode ¶ added in v1.1.0
func (*RpcClient) ValidatePermOrgById ¶ added in v1.1.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.