-
Notifications
You must be signed in to change notification settings - Fork 25
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: add optional owner param to syncer methods #58
feat: add optional owner param to syncer methods #58
Conversation
Previous implementation always used this.orgName for the required owner field, however the expected owner can be a user name, and not an org name[1]. For example, the Casdoor web app always sets the owner to "admin" [2]. This in turns make it impossible to retrieve syncers created through the web app using the SDK. This addition fixes this issue by adding an optional owner parameter to the syncer methods. [1]: https://github.com/casdoor/casdoor/blob/master/object/syncer.go#L71 [2]: https://github.com/casdoor/casdoor/blob/master/web/src/SyncerListPage.js#L30
@tangyang9464 @imp2002 please review |
|
@elierotenberg see the Go SDK: https://github.com/casdoor/casdoor-go-sdk/blob/master/casdoorsdk/syncer_test.go See the syncer test case and it passes. The CURD works. |
The Go SDK has the exact same problem. |
@elierotenberg what's wrong here? Do you think the test case is wrong? |
The test case isn't wrong, and there is not bug per se, rather that it is not currently possible to query the endpoint with an This is a debatable choice on the web app side as well however, the existence of a separate field The use case I am facing is:
The proposed change is fully backwards compatible and simply allows the caller to explicitly specify the |
@elierotenberg you should modify |
Previous implementation always used
this.orgName
for the requiredowner
field, however the expected owner can be a user name, and not an org name.For example, the Casdoor web app always sets the
owner
to "admin".This in turns make it impossible to retrieve syncers created through the web app using the SDK.
This addition fixes this issue by adding an optional owner parameter to the syncer methods.