mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-02-01 20:10:35 +01:00
# Description of Changes This PR performs a broad cleanup and refactor across the security, SSO, and dependency layers to improve correctness, maintainability, and robustness. ### What was changed - **SSO / Authentication cleanup** - Removed deprecated and ambiguous `SSO` authentication handling in favor of explicit `OAUTH2` and `SAML2`. - Introduced a centralized helper (`isSsoAuthenticationTypeByUsername`) to consistently detect SSO-backed users. - Hardened user creation logic to strictly validate authentication types and reject invalid values. - Updated OAuth2 and SAML2 authentication success handlers to use unified SSO detection logic and clearer control flow. - Adjusted tests to reflect the new canonical authentication types. - **Security & robustness improvements** - Replaced direct `new URL(...)` usage with `URI.create(...).toURL()` to avoid malformed URL edge cases. - Hardened `Referer` parsing logic to safely handle invalid or host-less URIs. - Improved string comparison patterns (`"literal".equals(x)`) to avoid potential `NullPointerException`s. - **Controller and API cleanup** - Removed large blocks of unused and legacy admin settings endpoints from `SettingsController`. - Updated OpenAPI annotations to use `requiredMode` instead of deprecated `required`. - **Dependency and build maintenance** - Updated Spring Boot from `3.5.7` to `3.5.9`. - Updated multiple dependencies (Spring Security, Jackson, Micrometer, Jetty, Hibernate, SnakeYAML, Springdoc, Swagger UI, etc.). - Synced dependency versions in `3rdPartyLicenses.json` and removed duplicate or obsolete entries. - Modernized Gradle DSL usage (`url =`, `username =`, `allowInsecureProtocol = true`). - Ensured Spotless disabling applies consistently across all subprojects. - Added `.build-cache` to `.gitignore`. ### Why the change was made - To eliminate legacy and ambiguous SSO handling that could lead to incorrect authentication decisions. - To improve security and stability when dealing with user-controlled URLs and headers. - To reduce technical debt by removing unused controllers and deprecated patterns. - To keep dependencies up to date and aligned with the current Spring Boot release. - To improve overall code clarity, consistency, and long-term maintainability. --- This pull request contains dependency updates, minor code cleanups, and some refactoring to improve maintainability and correctness. The most significant change is the removal of all admin settings endpoints (GET/POST) from the `SettingsController`, which impacts how application settings can be managed via the API. Additionally, there are dependency version bumps, minor improvements to static resource checks, and small refactors in certificate download logic and Telegram bot service. **Major API changes:** * Removed all admin settings endpoints (general, security, connections, privacy, advanced) from `SettingsController`, including both GET and POST handlers for updating and retrieving settings. This eliminates the ability to manage these settings via the API. **Dependency updates:** * Upgraded `snakeyaml-engine` from 2.10 to 3.0.1 and `springdoc-openapi-starter-webmvc-ui` from 2.8.14 to 2.8.15 in `build.gradle`. **Refactoring and bug fixes:** * Refactored static resource check in `RequestUriUtils.isStaticResource` to use constant-first string comparison for better null safety and clarity. * Updated certificate download logic in `CertificateValidationService` to use `URI.create(urlStr).toURL()` instead of `new URL(urlStr)` for improved URL parsing and error handling. [[1]](diffhunk://#diff-d2646f37bfd3e0963cbce16ab13edb52f2092795f54203b999dd82651154f26dL513-R514) [[2]](diffhunk://#diff-d2646f37bfd3e0963cbce16ab13edb52f2092795f54203b999dd82651154f26dL703-R704) * Refactored `TelegramPipelineBot` to consistently use `telegramProperties.getBotToken()` instead of `getBotToken()`, and removed the `getBotToken()` method override. [[1]](diffhunk://#diff-a2466b92f58750ea37960cd1533e3194d9ecc3b4ef5ad7b64a017ee0e636ad93L85-R85) [[2]](diffhunk://#diff-a2466b92f58750ea37960cd1533e3194d9ecc3b4ef5ad7b64a017ee0e636ad93L395-R395) [[3]](diffhunk://#diff-a2466b92f58750ea37960cd1533e3194d9ecc3b4ef5ad7b64a017ee0e636ad93L519-L523) --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details.
247 lines
3.7 KiB
Plaintext
247 lines
3.7 KiB
Plaintext
### Eclipse ###
|
|
.metadata
|
|
bin/
|
|
tmp/
|
|
*.tmp
|
|
*.bak
|
|
*.exe
|
|
*.swp
|
|
*~.nib
|
|
local.properties
|
|
.settings/
|
|
.loadpath
|
|
.recommenders
|
|
.classpath
|
|
.project
|
|
*.local.json
|
|
version.properties
|
|
|
|
#### Stirling-PDF Files ###
|
|
pipeline/
|
|
!pipeline/.gitkeep
|
|
customFiles/
|
|
configs/
|
|
watchedFolders/
|
|
clientWebUI/
|
|
!cucumber/
|
|
!cucumber/exampleFiles/
|
|
!cucumber/exampleFiles/example_html.zip
|
|
exampleYmlFiles/stirling/
|
|
/stirling/
|
|
/testing/file_snapshots
|
|
SwaggerDoc.json
|
|
|
|
# Frontend build artifacts copied to backend static resources
|
|
# These are generated by npm build and should not be committed
|
|
app/core/src/main/resources/static/assets/
|
|
app/core/src/main/resources/static/index.html
|
|
app/core/src/main/resources/static/locales/
|
|
app/core/src/main/resources/static/Login/
|
|
app/core/src/main/resources/static/classic-logo/
|
|
app/core/src/main/resources/static/modern-logo/
|
|
app/core/src/main/resources/static/og_images/
|
|
app/core/src/main/resources/static/samples/
|
|
app/core/src/main/resources/static/manifest-classic.json
|
|
app/core/src/main/resources/static/robots.txt
|
|
app/core/src/main/resources/static/pdfium/
|
|
app/core/src/main/resources/static/vendor/
|
|
# Note: Keep backend-managed files like fonts/, css/, js/, pdfjs/, etc.
|
|
|
|
# Gradle
|
|
.gradle
|
|
.gradle-home
|
|
.lock
|
|
|
|
# External tool builders
|
|
.externalToolBuilders/
|
|
|
|
# Locally stored "Eclipse launch configurations"
|
|
*.launch
|
|
|
|
# PyDev specific (Python IDE for Eclipse)
|
|
*.pydevproject
|
|
|
|
# CDT-specific (C/C++ Development Tooling)
|
|
.cproject
|
|
|
|
# CDT- autotools
|
|
.autotools
|
|
|
|
# Java annotation processor (APT)
|
|
.factorypath
|
|
|
|
# PDT-specific (PHP Development Tools)
|
|
.buildpath
|
|
|
|
# sbteclipse plugin
|
|
.target
|
|
|
|
# Tern plugin
|
|
.tern-project
|
|
|
|
# TeXlipse plugin
|
|
.texlipse
|
|
|
|
# STS (Spring Tool Suite)
|
|
.springBeans
|
|
|
|
# Code Recommenders
|
|
.recommenders/
|
|
|
|
# Annotation Processing
|
|
.apt_generated/
|
|
.apt_generated_test/
|
|
|
|
# Scala IDE specific (Scala & Java development for Eclipse)
|
|
.cache-main
|
|
.scala_dependencies
|
|
.worksheet
|
|
|
|
# Uncomment this line if you wish to ignore the project description file.
|
|
# Typically, this file would be tracked if it contains build/dependency configurations:
|
|
#.project
|
|
|
|
### Eclipse Patch ###
|
|
# Spring Boot Tooling
|
|
.sts4-cache/
|
|
|
|
### Git ###
|
|
# Created by git for backups. To disable backups in Git:
|
|
# $ git config --global mergetool.keepBackup false
|
|
*.orig
|
|
|
|
# Created by git when using merge tools for conflicts
|
|
*.BACKUP.*
|
|
*.BASE.*
|
|
*.LOCAL.*
|
|
*.REMOTE.*
|
|
*_BACKUP_*.txt
|
|
*_BASE_*.txt
|
|
*_LOCAL_*.txt
|
|
*_REMOTE_*.txt
|
|
|
|
### Java ###
|
|
# Compiled class file
|
|
*.class
|
|
|
|
# Log file
|
|
*.log
|
|
|
|
# BlueJ files
|
|
*.ctxt
|
|
|
|
# Mobile Tools for Java (J2ME)
|
|
.mtj.tmp/
|
|
|
|
# Package Files #
|
|
*.jar
|
|
*.war
|
|
*.nar
|
|
*.ear
|
|
*.zip
|
|
*.tar.gz
|
|
*.rar
|
|
*.db
|
|
build
|
|
app/core/build
|
|
app/common/build
|
|
app/proprietary/build
|
|
common/build
|
|
proprietary/build
|
|
stirling-pdf/build
|
|
|
|
# Byte-compiled / optimized / DLL files
|
|
__pycache__/
|
|
*.py[cod]
|
|
*.pyo
|
|
|
|
# Virtual environments
|
|
.env*
|
|
.venv*
|
|
env*/
|
|
venv*/
|
|
ENV/
|
|
env.bak/
|
|
venv.bak/
|
|
|
|
# VS Code
|
|
/.vscode/**/*
|
|
!/.vscode/settings.json
|
|
!/.vscode/extensions.json
|
|
|
|
# IntelliJ IDEA
|
|
.idea/
|
|
*.iml
|
|
out/
|
|
|
|
# Ignore Mac DS_Store files
|
|
.DS_Store
|
|
**/.DS_Store
|
|
|
|
# cucumber
|
|
/cucumber/reports/**
|
|
|
|
# Certs and Security Files
|
|
*.p12
|
|
*.pk8
|
|
*.pem
|
|
*.crt
|
|
*.cer
|
|
*.cert
|
|
*.der
|
|
*.key
|
|
*.csr
|
|
*.kdbx
|
|
*.jks
|
|
*.asc
|
|
|
|
# SSH Keys
|
|
*.pub
|
|
*.priv
|
|
id_rsa
|
|
id_rsa.pub
|
|
id_ecdsa
|
|
id_ecdsa.pub
|
|
id_ed25519
|
|
id_ed25519.pub
|
|
.ssh/
|
|
*ssh
|
|
|
|
# cache
|
|
.cache
|
|
.ruff_cache
|
|
.mypy_cache
|
|
.pytest_cache
|
|
.ipynb_checkpoints
|
|
.build-cache
|
|
|
|
|
|
**/jcef-bundle/
|
|
|
|
# node_modules
|
|
node_modules/
|
|
|
|
# weasyPrint
|
|
**/LOCAL_APPDATA_FONTCONFIG_CACHE/**
|
|
|
|
# Translation temp files
|
|
*_compact.json
|
|
*compact*.json
|
|
test_batch.json
|
|
*.backup.*.json
|
|
frontend/public/locales/*/translation.backup*.json
|
|
|
|
# Development/build artifacts
|
|
.gradle-cache/
|
|
scripts/pdf-collection/
|
|
**/tmp/
|
|
*.backup
|
|
|
|
# Type3 development data
|
|
docs/type3/signatures/
|
|
|
|
|
|
# Type3 sample PDFs (development only)
|
|
**/type3/samples/
|
|
|