Introduce comprehensive documentation covering architecture (ARCHITECTURE.md), concerns (CONCERNS.md), coding conventions (CONVENTIONS.md), integrations (INTEGRATIONS.md), technology stack (STACK.md), codebase structure (STRUCTURE.md), and testing patterns (TESTING.md). Enhance testing with additional test cases for external sign-in flows, ensuring accurate timestamp recording for identity links.
1.8 KiB
1.8 KiB
Coding Conventions
Naming Rules
| Item | Rule | Example | Evidence |
|---|---|---|---|
| Files | PascalCase for C# types | ExternalAuthenticationBroker.cs |
src/modules/Elsa.ExternalAuthentication/Services/ |
| Methods | PascalCase; async methods end in Async |
CompleteCallbackAsync |
ExternalAuthenticationBroker.cs |
| Interfaces | I prefix |
IExternalIdentityProvisioner |
ExternalAuthenticationContracts.cs |
| Locals/parameters | camelCase | signedInAt |
EFCoreExternalIdentityProvisioner.cs |
Formatting and Linting
- Formatter/rules: Roslyn
.editorconfigsettings. - Relevant rules: 4-space indentation, system usings first, braces required, file-scoped namespaces,
varpreferred. - Run commands:
dotnet format Elsa.slnwhen formatting is explicitly required; normal validation usesdotnet buildanddotnet test.
Import and Module Conventions
- Usings are outside namespaces and system directives sort first.
- Project namespaces follow the feature folder layout.
- Public contracts are kept in contract/model namespaces rather than persistence projects.
Error and Logging Conventions
- Services throw internal exceptions; broker endpoints translate failures to bounded public categories.
- Logging uses
Microsoft.Extensions.Loggingand structured message templates. - External authentication response DTOs omit subject hashes and sensitive tokens; redaction is covered by dedicated tests.
Testing Conventions
- Tests live under
test/{unit,integration,component,performance}and use xUnit. - Prefer real in-memory implementations; NSubstitute is used at external or expensive boundaries.
- Integration test coverage threshold defaults to 10% per project.
Evidence
.editorconfigDirectory.Build.propstest/Directory.Build.propstest/integration/Elsa.ExternalAuthentication.IntegrationTests/