Commit Graph

16 Commits

Author SHA1 Message Date
forehalo
8b0afd6eeb
refactor(server): auth (#7994) 2024-09-03 09:03:39 +00:00
forehalo
624f3514fc
feat(server): make permission a standalone module (#7880) 2024-08-15 10:01:52 +00:00
forehalo
638fc62601
feat(server): runtime setting support (#5602)
---

<details open="true"><summary>Generated summary (powered by <a href="https://app.graphite.dev">Graphite</a>)</summary>

> ## TL;DR
> This pull request adds a new migration file, a new model, and new modules related to runtime settings. It also introduces a new `Runtime` service that allows getting, setting, and updating runtime configurations.
>
> ## What changed
> - Added a new migration file `migration.sql` that creates a table called `application_settings` with columns `key` and `value`.
> - Added a new model `ApplicationSetting` with properties `key` and `value`.
> - Added a new module `RuntimeSettingModule` that exports the `Runtime` service.
> - Added a new service `Runtime` that provides methods for getting, setting, and updating runtime configurations.
> - Modified the `app.module.ts` file to import the `RuntimeSettingModule`.
> - Modified the `index.ts` file in the `fundamentals` directory to export the `Runtime` service.
> - Added a new file `def.ts` in the `runtime` directory that defines the runtime configurations and provides a default implementation.
> - Added a new file `service.ts` in the `runtime` directory that implements the `Runtime` service.
>
> ## How to test
> 1. Run the migration script to create the `application_settings` table.
> 2. Use the `Runtime` service to get, set, and update runtime configurations.
> 3. Verify that the runtime configurations are stored correctly in the database and can be retrieved and modified using the `Runtime` service.
>
> ## Why make this change
> This change introduces a new feature related to runtime settings. The `Runtime` service allows the application to dynamically manage and modify runtime configurations without requiring a restart. This provides flexibility and allows for easier customization and configuration of the application.
</details>
2024-05-28 06:43:53 +00:00
darkskygit
13f40f435d
feat: improve query performence (#6764) 2024-05-06 09:12:04 +00:00
darkskygit
1b0864eb60
feat: check quota correctly (#6561) 2024-04-16 09:41:48 +00:00
EYHN
f2adbdaba4
style: enable import-x/no-duplicates (#6279) 2024-03-25 03:55:33 +00:00
liuyi
fb3a0e7b8f
refactor(server): auth (#5895)
Remove `next-auth` and implement our own Authorization/Authentication system from scratch.

## Server

- [x] tokens
  - [x] function
  - [x] encryption

- [x] AuthController
  - [x] /api/auth/sign-in
  - [x] /api/auth/sign-out
  - [x] /api/auth/session
  - [x] /api/auth/session (WE SUPPORT MULTI-ACCOUNT!)

- [x] OAuthPlugin
  - [x] OAuthController
  - [x] /oauth/login
  - [x] /oauth/callback
  - [x] Providers
    - [x] Google
    - [x] GitHub

## Client

- [x] useSession
- [x] cloudSignIn
- [x] cloudSignOut

## NOTE:

Tests will be adding in the future
2024-03-12 10:00:09 +00:00
liuyi
e516e0db23
refactor(server): plugin modules (#5630)
- [x] separates modules into `fundamental`, `core`, `plugins`
- [x] optional modules with `@OptionalModule` decorator to install modules with requirements met(`requires`, `if`)
- [x] `module.contributesTo` defines optional features that will be enabled if module registered
- [x] `AFFiNE.plugins.use('payment', {})` to enable a optional/plugin module
- [x] `PaymentModule` is the first plugin module
- [x] GraphQLSchema will not be generated for non-included modules
- [x] Frontend can use `ServerConfigType` query to detect which features are enabled
- [x] override existing provider globally
2024-01-22 07:40:28 +00:00
liuyi
89b5c96d25
refactor(server): folder structure (#5573) 2024-01-12 04:18:39 +00:00
liuyi
12fdb18a80
test(server): make server testing utils (#5544) 2024-01-11 06:40:55 +00:00
liuyi
9253e522aa
test(server): avoid progress get hold after tests finished (#5522) 2024-01-11 06:40:53 +00:00
DarkSky
f6ec786ef9
feat: add workspace level feature apis (#5503) 2024-01-05 04:13:49 +00:00
DarkSky
04ca554525
feat: add workspace feature tests (#5501) 2024-01-05 04:13:47 +00:00
DarkSky
0c2d2f8d16
feat: struct type feature config (#5142) 2023-12-14 09:50:52 +00:00
DarkSky
2b7f6f8b74
feat: integrate new modules (#5087) 2023-12-14 09:50:46 +00:00
DarkSky
a93c12e122
feat: user usage gql & test case improve (#5076) 2023-12-14 09:50:42 +00:00