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: add optional AxiosRequestConfig parameter in constructor, add /introspect endpoint #60

Merged
merged 5 commits into from
Jun 3, 2024

Conversation

cidrmill
Copy link
Contributor

@cidrmill cidrmill commented Jun 2, 2024

I ran into issues with this library's use of Axios and the intranet self-signed enterprise certificate on the Casdoor instance. Calls to SDK.getAuthToken(code) would be met with:

Error: self-signed certificate in certificate chain
    at AxiosError.from (/projectroot/node_modules/.pnpm/[email protected]/node_modules/axios/dist/node/axios.cjs:837:14)

A solution is to provide an instance of https.Agent({ ca: string }) with the AxiosRequestConfig when creating the Axios instance. This wasn't possible as there was no exposed method to add a custom AxiosRequestConfig with creating a new SDK() instance.
I added an optional param axiosConfig?: AxiosRequestConfig to the SDK construction which is passed with new Request(...).

@casbin-bot
Copy link

@tangyang9464 @imp2002 please review

@hsluoyz
Copy link
Member

hsluoyz commented Jun 2, 2024

@cidrmill add the new usage to README as a comment: https://github.com/casdoor/casdoor-nodejs-sdk?tab=readme-ov-file#step1-init-sdk

image

@cidrmill cidrmill changed the title feat: add ability for custom AxiosRequestConfig in Sdk Add ability for custom AxiosRequestConfig in Sdk, and add /introspect endpoint Jun 2, 2024
@hsluoyz hsluoyz changed the title Add ability for custom AxiosRequestConfig in Sdk, and add /introspect endpoint feat: add optional AxiosRequestConfig parameter in constructor, add /introspect endpoint Jun 3, 2024
@hsluoyz hsluoyz merged commit 5567e61 into casdoor:master Jun 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants