Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
feat: Client 增加 SetPublicKey 方法,设置自定义公钥
Browse files Browse the repository at this point in the history
  • Loading branch information
luojielin committed Sep 2, 2022
1 parent 259c5d9 commit a0a2c4e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/authentication/authentication_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func NewClient(appId string, secret string, host ...string) *Client {
return c
}

func (c *Client) SetPublicKey(publicKey string) {
constant.PublicKey = publicKey
}

// TODO
func (c *Client) BuildAuthorizeUrlByOidc(params model.OidcParams) (string, error) {
if c.AppId == "" {
Expand Down
2 changes: 1 addition & 1 deletion lib/constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package constant

const StringEmpty = ""

const PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4xKeUgQ+Aoz7TLfAfs9+paePb5KIofVthEopwrXFkp8OCeocaTHt9ICjTT2QeJh6cZaDaArfZ873GPUn00eOIZ7Ae+TiA2BKHbCvloW3w5Lnqm70iSsUi5Fmu9/2+68GZRH9L7Mlh8cFksCicW2Y2W2uMGKl64GDcIq3au+aqJQIDAQAB"
var PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4xKeUgQ+Aoz7TLfAfs9+paePb5KIofVthEopwrXFkp8OCeocaTHt9ICjTT2QeJh6cZaDaArfZ873GPUn00eOIZ7Ae+TiA2BKHbCvloW3w5Lnqm70iSsUi5Fmu9/2+68GZRH9L7Mlh8cFksCicW2Y2W2uMGKl64GDcIq3au+aqJQIDAQAB"
4 changes: 4 additions & 0 deletions lib/management/management_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ func NewClient(userPoolId string, secret string, host ...string) *Client {
return c
}

func (c *Client) SetPublicKey(publicKey string) {
constant.PublicKey = publicKey
}

func NewClientWithError(userPoolId string, secret string, host ...string) (*Client, error) {
if userPoolId == "" {
return nil, errors.New("请填写 userPoolId 参数")
Expand Down

0 comments on commit a0a2c4e

Please sign in to comment.