casdoor / casdoor-go-sdk

Go client SDK for Casdoor
https://github.com/casdoor/casdoor
Apache License 2.0
88 stars 74 forks source link

fix: fixed getting users by only email, phone or userId without owner #96

Closed o-richard closed 9 months ago

o-richard commented 9 months ago

Hello,

When I was testing the different ways to obtain a single user, I figured out that the owner was being passed into the request. This caused the responses to be HTML error pages by Beego.

According to the PR, the owner does not need to be passed in.

I removed the owner parameter and added the accompanying tests

casbin-bot commented 9 months ago

@tangyang9464 @imp2002 please review

CLAassistant commented 9 months ago

CLA assistant check
All committers have signed the CLA.

hsluoyz commented 9 months ago

@o-richard failed

image

o-richard commented 9 months ago

Regarding the TestApplication failed test, even though the deletion was successful, an error is returned if you try to recover a deleted application. `

Stack
C:/Program Files/Go/src/runtime/panic.go:914
C:/Program Files/Go/src/runtime/panic.go:261
C:/Program Files/Go/src/runtime/signal_windows.go:364
C:/github_repos/c_d/controllers/application.go:114
C:/Program Files/Go/src/reflect/value.go:596
C:/Program Files/Go/src/reflect/value.go:380
C:/GoPath/pkg/mod/github.com/beego/beego@v1.12.12/router.go:897
C:/Program Files/Go/src/net/http/server.go:2938
C:/Program Files/Go/src/net/http/server.go:2009
C:/Program Files/Go/src/runtime/asm_amd64.s:1650
<div id="footer">
    <p>beego 1.12.3 (beego framework)</p>
    <p>golang version: go1.21.1</p>
</div>

`

hsluoyz commented 9 months ago

@o-richard the go test is passing now. This is expected.

Owner is a supported optional parameter for the API. There's nothing to change here.

If you want to use other parameter combinations for the API, that's fine. But we will not add it to this test set.

If you don't know why you get error about the API usage, just show the error and create issue at Casdoor repo. Don't first mess up with the Go SDK for now.

image