You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The`Insert*` functions must include ALL new fields, not just basic ones
138
+
- Common issue: Tests pass with real database but fail with in-memory database due to missing field mappings
139
+
- Always verify in-memory database functions match the real database schema after migrations
140
+
141
+
Example pattern:
142
+
143
+
```go
144
+
// In dbmem.go - ensure ALL fields are included
145
+
code := database.OAuth2ProviderAppCode{
146
+
ID: arg.ID,
147
+
CreatedAt: arg.CreatedAt,
148
+
// ... existing fields ...
149
+
ResourceUri: arg.ResourceUri, // New field
150
+
CodeChallenge: arg.CodeChallenge, // New field
151
+
CodeChallengeMethod: arg.CodeChallengeMethod, // New field
152
+
}
153
+
```
154
+
128
155
## Architecture
129
156
130
157
### CoreComponents
@@ -209,6 +236,12 @@ When working on OAuth2 provider features:
209
236
- Avoid dependency on referer headers for security decisions
210
237
- Support proper state parameter validation
211
238
239
+
6. **RFC 8707ResourceIndicators**:
240
+
- Store resource parameters in database for server-side validation (opaque tokens)
241
+
- Validate resource consistency between authorization and token requests
242
+
- Support audience validation in refresh token flows
243
+
- Resource parameter is optional but must be consistent when provided
244
+
212
245
### OAuth2ErrorHandlingPattern
213
246
214
247
```go
@@ -237,6 +270,114 @@ if errors.Is(err, errInvalidPKCE) {
237
270
- Test both positive and negative cases
238
271
- Use`testutil.WaitLong`for timeouts in tests
239
272
273
+
## CodeNavigation and Investigation
274
+
275
+
### UsingGoLSPTools (STRONGLY RECOMMENDED)
276
+
277
+
**IMPORTANT**: Always use GoLSP tools for code navigation and understanding. These tools provide accurate, real-time analysis of the codebase and should be your first choice for code investigation.
278
+
279
+
When working with the Coder codebase, leverage GoLanguageServerProtocol tools for efficient code navigation:
280
+
281
+
1. **Find function definitions** (USE THISFREQUENTLY):
0 commit comments