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

💄 style: Support webhooks for casdoor #3942

Merged
merged 3 commits into from
Sep 20, 2024
Merged

Conversation

cy948
Copy link
Contributor

@cy948 cy948 commented Sep 13, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

  • src/app/api/webhooks/casdoor/__tests__/route.test.ts: Local dev 测试 case;
  • src/app/api/webhooks/casdoor/route.ts: 处理 Casdoor Event;
  • src/app/api/webhooks/casdoor/validateRequest.ts: 检查 request 合法性,目前使用固定 secret;
  • src/libs/next-auth/sso-providers/casdoor.ts: 添加 Casdoor SSO Provider;

📝 补充信息 | Additional Information

  1. Casdoor SSO Provider:
  1. Webhook 使用指南:
  • 前往Casdoor控制台 /webhooks 创建一个 webhook
  • 选择 hook 事件为: update-user
  • 配置 Webhooks 地址为 <protocol>://<host>:<port>/api/webhooks/casdoor
  • 勾选“拓展字段”选项
  • 协议头添加:casdoor-secret,值为任意 secret,要与LobeChat环境变量 CASDOOR_WEBHOOK_SECRET 一致。

Link issues:

Copy link

vercel bot commented Sep 13, 2024

@cy948 is attempting to deploy a commit to the LobeHub Pro Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @cy948

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.73%. Comparing base (0e0d208) to head (fb91d1c).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #3942     +/-   ##
=========================================
  Coverage   91.73%   91.73%             
=========================================
  Files         481      481             
  Lines       34209    34215      +6     
  Branches     3296     2236   -1060     
=========================================
+ Hits        31382    31388      +6     
  Misses       2827     2827             
Flag Coverage Δ
app 91.73% <100.00%> (+<0.01%) ⬆️
server 97.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cy948 cy948 marked this pull request as ready for review September 13, 2024 03:56
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 🌠 Feature Request New feature or request | 特性与建议 labels Sep 13, 2024
@arvinxx arvinxx changed the title ✨ feat: Support webhooks for casdoor 💄 style: Support webhooks for casdoor Sep 20, 2024
Copy link

vercel bot commented Sep 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 2:14pm

@arvinxx arvinxx merged commit 1f2f6a5 into lobehub:main Sep 20, 2024
5 of 7 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @cy948 ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

github-actions bot pushed a commit that referenced this pull request Sep 20, 2024
### [Version&nbsp;1.19.12](v1.19.11...v1.19.12)
<sup>Released on **2024-09-20**</sup>

#### 💄 Styles

- **misc**: Support webhooks for casdoor.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Support webhooks for casdoor, closes [#3942](#3942) ([1f2f6a5](1f2f6a5))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.19.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

@cy948 cy948 deleted the feat/casdoor branch September 20, 2024 14:59
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Sep 20, 2024
### [Version&nbsp;1.62.3](v1.62.2...v1.62.3)
<sup>Released on **2024-09-20**</sup>

#### 🐛 Bug Fixes

- **misc**: Custom model initialization not taking effect error.

#### 💄 Styles

- **misc**: Add qwen2.5 math and coder model for siliconcloud provider, support webhooks for casdoor.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Custom model initialization not taking effect error, closes [lobehub#4038](https://github.com/bentwnghk/lobe-chat/issues/4038) ([0e0d208](0e0d208))

#### Styles

* **misc**: Add qwen2.5 math and coder model for siliconcloud provider, closes [lobehub#4043](https://github.com/bentwnghk/lobe-chat/issues/4043) ([d16578f](d16578f))
* **misc**: Support webhooks for casdoor, closes [lobehub#3942](https://github.com/bentwnghk/lobe-chat/issues/3942) ([1f2f6a5](1f2f6a5))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
cy948 added a commit to cy948/lobe-chat that referenced this pull request Sep 21, 2024
* ✨ feat: Support Casdoor provider

* ✨ feat: + webhook for casdoor

* 🐛 fix: skip test
cy948 pushed a commit to cy948/lobe-chat that referenced this pull request Sep 21, 2024
### [Version&nbsp;1.19.12](lobehub/lobe-chat@v1.19.11...v1.19.12)
<sup>Released on **2024-09-20**</sup>

#### 💄 Styles

- **misc**: Support webhooks for casdoor.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Support webhooks for casdoor, closes [lobehub#3942](lobehub#3942) ([1f2f6a5](lobehub@1f2f6a5))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌠 Feature Request New feature or request | 特性与建议 released size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
3 participants