Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cloudindustry): support searchKey and limit #2076

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/aws/aws-sdk-go v1.40.37
github.com/bitly/go-simplejson v0.5.0
github.com/caddyserver/caddy v1.0.5
github.com/caryxychen/cloudindustry-sdk-go v1.0.0
github.com/caryxychen/cloudindustry-sdk-go v1.0.1
github.com/casbin/casbin/v2 v2.2.1
github.com/chartmuseum/helm-push v0.9.0
github.com/chartmuseum/storage v0.11.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3k
github.com/caddyserver/caddy v1.0.5 h1:5B1Hs0UF2x2tggr2X9jL2qOZtDXbIWQb9YLbmlxHSuM=
github.com/caddyserver/caddy v1.0.5/go.mod h1:AnFHB+/MrgRC+mJAvuAgQ38ePzw+wKeW0wzENpdQQKY=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/caryxychen/cloudindustry-sdk-go v1.0.0 h1:bsdS6BP49K+VCzHbsa+hUEmOfryXuDpxdFrA24Z67vo=
github.com/caryxychen/cloudindustry-sdk-go v1.0.0/go.mod h1:ZqQXwtco2MGa2s6MAP6snl5bg/M+0rufb7E8zDuCn1M=
github.com/caryxychen/cloudindustry-sdk-go v1.0.1 h1:hHJ8G9nZLl4bLiTfpdvGycc9u2nXGlKx4iWKedAmj0U=
github.com/caryxychen/cloudindustry-sdk-go v1.0.1/go.mod h1:ZqQXwtco2MGa2s6MAP6snl5bg/M+0rufb7E8zDuCn1M=
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/casbin/casbin/v2 v2.2.1 h1:ijrSMfBfbQlDc4LnMTGtGYWmhKuuR6RLSQRj8vHrMzc=
github.com/casbin/casbin/v2 v2.2.1/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,19 @@ func (i *identityProvider) ListUsers(ctx context.Context, options *metainternal.
accountsRequest.AccountIds = ids.Response.SubIds
if options != nil {
keyword, limit := util.ParseQueryKeywordAndLimit(options)
params := accountsRequest.GetParams()
params["SearchKey"] = keyword
params["Limit"] = strconv.Itoa(limit)
accountsRequest.SearchKey = keyword
accountsRequest.Limit = strconv.Itoa(limit)
}
bytes, _ := json.Marshal(accountsRequest.GetParams())
log.Infof("request params '%s'", string(bytes))
bytes, _ := json.Marshal(accountsRequest)
log.Debugf("request '%s'", string(bytes))

accounts, err := i.client.DescribeAccounts(accountsRequest)
if err != nil {
log.Warnf("failed to describe accounts, err '%v'", err)
return nil, apierrors.NewInternalError(err)
}
bytes, _ = json.Marshal(accounts)
log.Infof("accounts '%s'", string(bytes))
log.Debugf("accounts '%s'", string(bytes))
if accounts.Response == nil || len(accounts.Response.Accounts) == 0 {
return &auth.UserList{}, nil
}
Expand Down