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

Dev #20

Merged
merged 59 commits into from
Oct 14, 2024
Merged

Dev #20

merged 59 commits into from
Oct 14, 2024

Conversation

vnobo
Copy link
Owner

@vnobo vnobo commented Oct 14, 2024

#19
Fixes #

… converters and utilities with documentation and error handling

- Adds descriptive Javadoc comments to converters for UserAuditor, QueryFragment, ContextUtils, JsonNodeConverters, BeanUtils, and CollectionConverters.
- Introduces error handling in converters to manage exceptions during JSON processing.
- Includes initialization logs for ContextUtils and CollectionConverters.
- Refines the conversion logic with more robust type handling and clearer intent.
…tils.java`): Add null property check and update Javadoc comments

This commit introduces enhancements to `BeanUtils` by adding functionality to retrieve a list of property names with null values from the source object. It also updates the Javadoc comments to better describe the class and its methods, improving code documentation and readability.
…LoggersService.java`): 为日志服务添加搜索和分页功能。

✨ feat(`boot/platform/src/main/java/com/plate/boot/config/WebConfiguration.java`): 配置 Web 相关设置,包括 RSocket 设置、调度、异步方法处理和自定义参数解析器。

✨ feat(`boot/platform/src/main/java/com/plate/boot/commons/GlobalExceptionHandler.java`): 全局异常处理程序,处理各种异常并返回标准化的错误响应。

✨ feat(`boot/platform/src/main/java/com/plate/boot/relational/logger/Logger.java`): 为日志实体添加了更多字段,包括代码、租户代码、操作符、前缀、URL、方法、状态、上下文、创建时间和更新时间。

✨ feat(`boot/platform/src/main/java/com/plate/boot/config/RedisConfiguration.java`): 配置 Redis 缓存和反应式 Redis 操作。

✨ feat(`boot/platform/src/main/java/com/plate/boot/commons/GlobalExceptionHandler.java`): 处理特定类型的异常,如 DataAccessException 和 R2dbcException,并返回适当的错误响应。

✨ feat(`boot/platform/src/main/java/com/plate/boot/relational/logger/LoggerRequest.java`): 将 `LoggerRequest` 转换为 `Logger` 实体,并构建查询片段。

✨ feat(`boot/platform/src/main/java/com/plate/boot/config/SessionConfiguration.java`): 配置会话管理,包括自定义会话 ID 解析和 Bearer 令牌支持。

✨ feat(`boot/platform/src/main/java/com/plate/boot/relational/logger/LoggersRepository.java`): 添加了根据创建时间删除日志记录的方法。

✨ feat(`boot/platform/src/main/java/com/plate/boot/relational/logger/LoggersController.java`): 处理日志记录的分页和搜索。
…java`, `R2dbcConfiguration.java`, `SecurityConfiguration.java`, `LoggerFilter.java`): Enhance code documentation and refine security configurations

This commit introduces comprehensive documentation comments for the `Menu` class, improving the understanding of its structure and methods. Additionally, it augments security configurations in `SecurityConfiguration.java` with detailed explanations for OAuth2 client services, session registry, password encoding, RSocket security, and CSRF protection customization. Furthermore, it refines Redis cache management in `RedisConfiguration.java` and enhances database connection setup in `R2dbcConfiguration.java`. Lastly, it bolsters request-response logging mechanics in `LoggerFilter.java` with clearer commentary.
```markdown
🔥 chore(`SecurityDetails`, `ErrorResponse`, `UsersService`, `GlobalExceptionHandler`, `SecurityConfiguration`, `RestServerException`): Refactor error handling and exception management

Refactored error responses to use HttpStatusCode, simplified exception constructors, and improved readability by removing redundant code and enhancing exception messages. Also, restructured the SecurityDetails class for better organization and security practices.
```
…Auditor.java`): 在 `UserAuditor` 类中添加了 `getCurrentAuditor` 方法,用于获取当前用户的审计信息。

✨ feat(`boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryHelper.java`): 在 `QueryHelper` 类中添加了对查询条件的处理,支持字符串类型的查询条件。

✨ feat(`boot/platform/src/main/java/com/plate/boot/security/core/UserAuditor.java`): 在 `UserAuditor` 类中添加了 `of` 方法,用于创建 `UserAuditor` 实例。

✨ feat(`boot/platform/src/main/java/com/plate/boot/security/core/UserAuditor.java`): 在 `UserAuditor` 类中添加了 `withCode` 方法,用于创建具有指定代码的 `UserAuditor` 实例。

✨ feat(`boot/platform/src/main/java/com/plate/boot/security/core/UserAuditor.java`): 在 `UserAuditor` 类中添加了 `withDetails` 方法,用于创建具有指定安全细节的 `UserAuditor` 实例。

✨ feat(`boot/platform/src/main/java/com/plate/boot/security/core/UserAuditor.java`): 在 `UserAuditor` 类中添加了 `withUser` 方法,用于创建具有指定用户的 `UserAuditor` 实例。
…hentication token, CSRF token, OAuth2 client binding, and password change.
… message style

This commit modifies the Visual Studio Code workspace settings by adding the "Codegeex.RepoIndex" configuration to enable repository indexing and updates the "Codegeex.CommitMessageStyle" to enforce the use of Conventional Commits, ensuring standardized commit messages across the project.
…plement session management with Spring Session for reactive applications.
…tabase and utility classes

This commit removes several deprecated classes related to database abstraction (`AbstractDatabase`, `AbstractService`, `BaseEntity`) and utility converters (`CollectionConverters`, `JsonNodeConverters`, `UserAuditorConverters`). These changes streamline the codebase and pave the way for updated implementations or external dependency management.
…essential files

This commit sets up a new Angular project, including configuration files such as `.editorconfig`, `.gitignore`, `angular.json`, and `tsconfig.*.json`. It also adds basic project structure with `index.html`, `main.ts`, and necessary scripts. Additionally, it installs and configures project dependencies for both development and production environments.
✨ feat(`environments`, `angular.json`, `package.json`, `services`, `styles.scss`, `app.config.ts`, `proxy.conf.json`, `.prettierrc.json`, `.vscode/settings.json`): Implement application environment setup, add services, configure routing, and improve project configurations

- Adds development and production environment configurations
- Updates Angular JSON to include Bootstrap CSS and JS, removes unnecessary polyfills, sets up proxy configuration, and adjusts build targets
- Installs and configures Bootstrap and DayJS dependencies
- Introduces BrowserStorage and SessionStorage services for local and session storage management
- Implements HTTP Interceptors for default request handling and authentication token management
- Adds a page title strategy service for dynamic page titles
- Adjusts global SCSS styles and includes them in the project
- Enhances app routing with custom title strategy and HTTP client configurations
- Initializes a proxy configuration for backend API and RSocket communication
- Sets up Prettier and VSCode settings for code formatting and linting
```
…actDatabase.java`): Optimize cache handling and remove unnecessary imports
…necessary serialization calls and simplify logic

This commit eliminates redundant serialization calls within the `SecurityManager` and optimizes caching operations in `LoggerFilter`, enhancing code readability and efficiency.
… Bootstrap paths and streamline app component HTML.
…ock.json

Commit Detail:
- Change SQL initialization mode to 'always' in application-local.yml for ensuring database setup on every startup.
- Delete redundant package-lock.json from ng-ui to resolve potential dependency conflicts and ensure clean npm operations.
Delete outdated authentication, storage, and utility services, and incorporate the ng-zorro-antd UI library for improved UI components and icons, enhancing the application's visual and functional aspects.
This commit introduces Angular Material by updating package dependencies, adding prebuilt theme CSS, and adjusting HTML head links. It also enhances index.html structure and adds necessary attributes to anchor tags for security. Additionally, it refines the global styles and prepares the application for using Angular animations.
Concise summary:
- Remove outdated authentication, storage, and interceptor services
- Add HomePage component with updated layout and navigation
- Implement core utilities for better UI feedback (progress bar, back-to-top button)

Details:
This commit addresses the deprecation of several services by removing them from the application. The affected services include authentication, browser storage, HTTP interceptors, and related utility services like loading and session storage. These removals pave the way for updated implementation or externalization of these functionalities.

Simultaneously, a new HomePage component has been introduced, featuring a refreshed layout with responsive sidebar navigation, header, and content area. This component leverages Ng-Zorro-Antd components for a consistent and modern UI design.

Additionally, core utilities have been enhanced with the introduction of a progress bar service to indicate background tasks and a back-to-top button for improved user experience on lengthy pages. These changes collectively modernize the application's infrastructure and frontend experience.
* Reformatted HTML structure in `index.html` for better readability and consistency.
* Added `package-lock.json` for the `ng-ui` project, ensuring dependencies are locked to specific versions for reproducible builds.
This commit updates the Spring Boot plugin version from 3.3.3 to 3.3.4 in build.gradle and formats the HTML in ng-web/src/index.html for better readability without changing its functionality.
This commit introduces routing for the home page by creating a new file `home.routes.ts` which defines the route configuration for the `HomeComponent`. Additionally, it extends the `app.routes.ts` to include the new home route alongside the existing ones, ensuring the home page is integrated into the application's navigation flow. The `HomeComponent`'s `ngOnInit` method has also been updated to remove unnecessary empty function body.
在NumPy文档中,常规介绍部分现在包含了关于字符串、字节和void数据类型的信息,以及现有的数值类型。
Adjust the precision of the timing output in Filter's status report to display up to
two significant figures. This provides a clearer and more consistent presentation of timing
results without extending the precision unnecessarily.
```
…figAdd a comment with a link to the Spring Security Reference documentation in the

SecurityConfig class to provide maintainers with a quick reference to Spring Security
configuration details
vnobo added 23 commits October 9, 2024 21:22
Introduce a new `ChangePasswordRequest` class to handle password change requests, including validation and example usage. Add corresponding tests for the `SecurityController` to cover password change scenarios, including successful updates and error handling for invalid requests. Also, update the build configuration to include necessary dependencies for testing.
Introduce `ChangePasswordRequest` class for handling password change requests with validation. Update `SecurityController` with password change endpoints and corresponding tests for successful updates and error handling. Adjust build configuration to include necessary dependencies for testing.
- 移除了 QueryHelperTest 类,该类包含对 QueryHelper 类的单元测试
- 添加了 WebConfigurationTest 类,该类为测试配置类,设置了自定义参数解析器
- 删除了 UsersControllerTest 类,该类包含对 UsersController 的集成测试
- 更新了 BootApplicationTest 类,添加了 WebConfigurationTest 的导入,并调整了测试方法的名称
- 添加了 application-test.yml 文件,配置了日志、数据库连接、Redis和OAuth2客户端注册信息
- 在 contextLoadsTest 方法中增加了 RSA 加密和解密的测试逻辑
- 新增的测试逻辑验证了使用 RSA 算法生成的密钥对可以成功加密和解密消息
- 通过引入 javax.crypto 包中的类来实现加密和解密功能
测试方法"contextLoadsTest"已重命名为"rsaKeyPairGeneratorTest",更准确地反映了其测试目的。同时,移除了测试类中不必要的@SpringBootTest注解配置,因为当前测试不需要启动整个Spring应用上下文。
在SecurityController类的类声明上方添加了注释,详细描述了该类的功能和依赖。这增强了代码的可读性和可维护性,为开发人员提供了清晰的类职责说明。
- Remove unused import of Log4j2
- Enhance class and method comments with more detailed explanations
- Add Lombok @DaTa annotation to CommandRequest and ConnectedClient classes- Improve method signature for ConnectedClient constructor
…s` 数组。

✨ feat(`ng-web/package.json`): 添加 `bootstrap-icons` 依赖。
♻️ refactor(`ng-web/package-lock.json`): 更新 `package-lock.json` 以包含 `bootstrap-icons` 依赖。
… 和信号机制。

✨ feat(`ng-web/angular.json`): 更新 Angular 配置以使用最新的 polyfills。

♻️ refactor(`ng-web/package-lock.json`): 更新依赖版本以匹配最新稳定版。
✨ feat(welcome): 添加注册表单及验证
✨ refactor(routes): 更新路由配置
✨ refactor(prettier): 调整代码格式化配置
✨ refactor(angular.json): 更新 Angular 构建配置
…` output:

1. 🚚 chore(`ng-web/src/app/core`): Move `browser-storage.ts` and `session-storage.ts` to `storage` directory.
2. 🎨 style(`ng-web/src/app/pages/login/login.component.html`): Fix HTML tag mismatch.
3. 📝 feat(`ng-web/src/app/core/auth.service.ts`): Update login URL and import path for `SessionStorageService`.
4. 🐛 fix(`boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryHelper.java`): Correct the filter condition in `criteria` method.
5. ✨ feat(`ng-web/src/app/core/icons-provider.ts`): Add `HomeOutline` icon to the list.
6. 📝 feat(`ng-web/src/app/pages/home/home.component.html`): Update navigation menu titles and links.
7. 🎨 style(`ng-web/src/app/pages/home/menus/menus.component.scss`): Add styles for `menus.component`.
8. ✨ feat(`ng-web/src/app/pages/home/menus/menus.component.ts`): Implement `MenusComponent` with menu data retrieval and tree structure handling.
9. 🎨 style(`ng-web/src/app/pages/home/menus/menus.component.html`): Create HTML structure for `MenusComponent` with expandable menu items.
10. ✨ feat(`ng-web/src/app/pages/home/menus/menu-form.component.ts`): Implement `MenuFormComponent` for menu editing.
11. 📝 feat(`ng-web/src/app/pages/home/home.routes.ts`): Define routes for `HomeComponent` with authentication guard.
12. 📝 feat(`ng-web/src/app/pages/login/login.service.ts`): Update import path for `SessionStorageService`.
13. ✨ feat(`ng-web/src/app/core/storage/browser-storage.ts`): Create `BrowserStorage` service.
14. ✨ feat(`ng-web/src/app/core/storage/session-storage.ts`): Create `SessionStorageService`.
15. ✨ feat(`ng-web/src/app/pages/home/menus/menus.service.ts`): Implement `MenusService` for menu data retrieval.
…rvice`服务,用于管理会话存储。

✨ feat(`ng-web/src/app/core/http.Interceptor.ts`): 在`defaultInterceptor`中添加消息服务,用于显示错误信息。
✨ feat(`ng-web/src/app/core/http.Interceptor.ts`): 在`authTokenInterceptor`中添加消息服务,用于显示错误信息。
✨ feat(`ng-web/src/app/core/icons-provider.ts`): 添加新的图标到图标提供者。
✨ feat(`ng-web/src/app/pages/home/home.component.html`): 更新首页组件的HTML模板,包括侧边栏菜单和面包屑导航。
✨ feat(`ng-web/src/app/pages/home/home.component.scss`): 更新首页组件的样式,包括侧边栏菜单和面包屑导航。
✨ feat(`ng-web/src/app/pages/home/menus/menus.component.ts`): 更新菜单组件的构造函数。
✨ feat(`ng-web/src/app/pages/home/home.component.ts`): 更新首页组件的构造函数,添加菜单服务依赖。
✨ feat(`ng-web/src/app/pages/home/home.routes.ts`): 更新首页路由配置,使用`data`属性设置路由标题。
✨ feat(`ng-web/src/theme.less`): 更新主题样式文件,引入暗黑主题样式。
✨ feat(`ng-web/src/app/app.config.ts`): 更新应用配置,引入`NzConfig`配置。
✨ feat(`ng-web/src/app/app.routes.ts`): 更新应用路由配置,使用`data`属性设置路由标题。
✨ feat(`ng-web/src/app/pages/login/login.service.ts`): 更新登录服务,修改会话存储服务的引用路径。
✨ feat(`ng-web/src/app/core/session-storage.ts`): 新增`SessionStorageService`服务,用于管理会话存储。
✨ feat(`ng-web/src/app/pages/home/menus/menus.service.ts`): 更新菜单服务,修改HTTP请求的URL和参数。
✨ feat(`ng-web/src/app/core/auth.service.ts`): 更新认证服务,修改会话存储服务的引用路径。
✨ feat(`boot/platform/src/main/resources/data-postgres.sql`): 更新数据库初始化脚本,修改菜单图标。
@vnobo vnobo self-assigned this Oct 14, 2024
Copy link

gitguardian bot commented Oct 14, 2024

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
8787685 Triggered GitHub App Keys a58a34a boot/platform/src/test/resources/application-test.yml View secret
8787685 Triggered GitHub App Keys c9403e1 boot/platform/src/test/resources/application-test.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

vnobo added 2 commits October 14, 2024 17:56
# Conflicts:
#	boot/platform/src/main/java/com/plate/boot/config/SecurityConfiguration.java
#	boot/platform/src/main/java/com/plate/boot/config/SessionConfiguration.java
#	boot/platform/src/main/java/com/plate/boot/relational/LoggerFilter.java
#	boot/platform/src/main/java/com/plate/boot/security/SecurityController.java
#	boot/platform/src/main/java/com/plate/boot/security/core/user/UsersController.java
#	boot/platform/src/main/java/com/plate/boot/security/core/user/UsersService.java
@vnobo vnobo closed this Oct 14, 2024
@vnobo vnobo reopened this Oct 14, 2024
@vnobo vnobo merged commit 514f139 into main Oct 14, 2024
9 of 10 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.

1 participant