Repository navigation
Releases: defless/OAuth-2.1-example
Releases · defless/OAuth-2.1-example
Release list
Refactor using AWS Ai Development software lifecycle
Release Notes: AI-DLC Refactoring v2.0
This release documents the completion of the AI-Driven Development Lifecycle (AI-DLC) refactoring on the project.
📋 AI-DLC Execution Summary
| Phase | Status |
|---|---|
| Inception | ✅ Complete |
| Construction (Units 1–4) | ✅ Complete |
| Operations | ✅ Closed |
Inception Phase
- Workspace Detection
- Reverse Engineering
- Requirements Analysis
- Workflow Planning
- Units Generation
Construction Phase
| Unit | Scope | Status |
|---|---|---|
| Unit 1 | Core & Models | ✅ Done |
| Unit 2 | Middlewares | ✅ Done |
| Unit 3 | Controllers | ✅ Done |
| Unit 4 | Routes | ✅ Done |
🛠️ What's Changed
Unit 4: Routes (Primary Deliverable)
- Renamed
ressources.ts→resources.tsand corrected all paths from/ressourcesto/resources - Deleted 4 legacy
.jsroute files (auth.js,helpers.js,index.js,ressources.js) - Fixed
auth.tsregister schema: correctedusernameproperty toemail - Added JSON Schema response validation for
/resources/*endpoints - Added querystring + response schemas for
/helpers/pkceand/helpers/callback - Updated tests to use
/resourcesinstead of deprecated/ressources
TypeScript Migration
- Rewrote
tsconfig.jsonwith properskipLibCheck,bun-types,allowImportingTsExtensions, andnoEmit - Removed 3 stale
.jsfiles insrc/core/(env.js,types.js,utils.js) - Fixed
server.tserror handler typing for strict TypeScript compliance - Improved
tests/utils/request.tsreturn types
Linting Overhaul
- Migrated from
.eslintrc(legacy) toeslint.config.js(flat config) - Adopted
@poool/eslint-configas the shared lint standard - Removed old dependencies:
eslint-config-airbnb-base,@typescript-eslint/*v7 - Added
@eslint/jsas an explicit peer dependency for CI stability - Resolved ESLint 9.x /
@poool/eslint-config/typescript-eslintversion matrix incompatibilities - Generated
bun.lockfor reproducible dependency installs
CI/CD Modernization
- Migrated CI from Node.js/Yarn to Bun (
oven-sh/setup-bun@v2) - Replaced matrix Node builds with a single Bun runner
- Fixed dynamic port allocation (
port: 0) in tests to avoid hardcoded 3000 conflicts - Fixed test request helper so
GETno longer sends a body - Fixed
package.jsonformatting (removed trailing comma that causedmongodb-memory-serverJSON parse crash)
Security Hardening
- Authorization middleware now explicitly validates the
Bearerscheme instead of accepting any scheme (e.g.Basic) generateAccessTokennow readsPRIVATE_KEYdynamically fromprocess.envat call time instead of caching it at module load — prevents silent failures when.envis missing
🧪 Test Results
bun test v1.2.0
✓ /helpers > PKCE generation
✓ /auth > authenticate (password grant)
✓ /auth > authenticate (password grant) > unknown user
✓ /auth > authenticate (password grant) > invalid grant
✓ /auth > authenticate (refresh_token grant)
✓ /auth > authenticate (client_credentials grant)
✓ /resources > GET unrestricted
✓ /resources > GET restricted
8 pass · 0 fail · 19 assertions
⚠️ Breaking Changes
- CI now requires Bun instead of Node.js + Yarn.
v2.0.0
🥊 Refactor:
- This is now a fastify API using typescript.
✨ New features:
- A postman library available in the README to test api endpoints
- A fancy (😂) new name
- An adaptation to new OAuth 2.1 standards such as:
1 -authorization_codegrant type using a third party provider (github & google)
2 -client_credentialsgrant type to authenticate registered clients (like front-end applications)
3 - PKCE process for google authorization code flow