Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions cmd/oe/HOW_TO_TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ curl -X POST http://localhost:4000/sdl/validate \

### 5. Compatibility Checking Tests

#### TC-009: Check Backward Compatible Changes
#### TC-009: Detect Breaking Schema Changes
**Command**:
```bash
curl -X POST http://localhost:4000/sdl/check-compatibility \
Expand All @@ -186,9 +186,12 @@ curl -X POST http://localhost:4000/sdl/check-compatibility \
}
```

### 6. Federator Integration Tests
### 6. Policy Gate Integration Tests

#### TC-010: Test Federator with Database Schema (Version 1.0.0)
These cases stop at PDP/CE rejection before federation runs. They confirm policy
integration wiring, not federator/schema-selection/array-processing success.

#### TC-010: Federated Query Blocked by Consent Engine (Schema Version 1.0.0)
**Command**:
```bash
curl -X POST http://localhost:4000/ \
Expand All @@ -197,7 +200,7 @@ curl -X POST http://localhost:4000/ \
"query": "query GetData { personInfo(nic: \"199512345678\") { fullName } }"
}'
```
**Result**: **PASSED** - Federator using database schema:
**Result**: **PASSED** - Request reaches CE and is rejected while consent is pending:
```json
{
"data": null,
Expand All @@ -214,7 +217,7 @@ curl -X POST http://localhost:4000/ \
}
```

#### TC-011: Test Federator with Database Schema (Version 1.1.0)
#### TC-011: Federated Query Blocked by PDP (Schema Version 1.1.0)
**Command**:
```bash
curl -X POST http://localhost:4000/ \
Expand All @@ -223,7 +226,7 @@ curl -X POST http://localhost:4000/ \
"query": "query { hello }"
}'
```
**Result**: **PASSED** - Federator using new active schema from database:
**Result**: **PASSED** - Request reaches PDP and is rejected:
```json
{
"data": null,
Expand All @@ -238,9 +241,12 @@ curl -X POST http://localhost:4000/ \
}
```

### 7. Array and Non-Array Query Tests
### 7. Policy Gate Tests for Array and Nested Queries

Same gate behavior as above; these queries never reach array/non-array federation
processing while PDP/CE reject the request.

#### TC-012: Array Query Test
#### TC-012: Array Query Blocked by PDP
**Command**:
```bash
curl -X POST http://localhost:4000/ \
Expand All @@ -249,7 +255,7 @@ curl -X POST http://localhost:4000/ \
"query": "query GetData { personInfo(nic: \"199512345678\") { ownedVehicles { regNo make model year } } }"
}'
```
**Result**: **PASSED** - Array processing working correctly:
**Result**: **PASSED** - Array-shaped query rejected by PDP before federation:
```json
{
"data": null,
Expand All @@ -264,7 +270,7 @@ curl -X POST http://localhost:4000/ \
}
```

#### TC-013: Non-Array Query Test
#### TC-013: Nested Query Blocked by Consent Engine
**Command**:
```bash
curl -X POST http://localhost:4000/ \
Expand All @@ -273,7 +279,7 @@ curl -X POST http://localhost:4000/ \
"query": "query GetData { personInfo(nic: \"199512345678\") { profession otherNames birthInfo { birthRegistrationNumber birthPlace } } }"
}'
```
**Result**: **PASSED** - Non-array processing working correctly:
**Result**: **PASSED** - Nested query rejected by CE before federation:
```json
{
"data": null,
Expand Down Expand Up @@ -336,8 +342,7 @@ uses `unified_schemas` table from database and falls back to
3. **Schema Management**: Full CRUD operations working with database persistence
4. **Real-time Switching**: Schema activation changes immediately reflected in federator
5. **Error Handling**: Robust error handling with proper fallback mechanisms
6. **Array Processing**: Both array and non-array queries processed correctly
7. **Policy Integration**: PDP and CE integration working correctly
6. **Policy Integration**: PDP and CE rejection paths are exercised by federated queries (TC-010–TC-013)

## SQL Commands for Database Management

Expand Down
2 changes: 1 addition & 1 deletion cmd/oe/PROVIDER_CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ new provider, Registrar General Department of Farajaland (RGDF), as an example.
```graphql
query PersonInfoQueryrgdf {
getPersonInfo {
name
fullName
birthRegistrationNumber
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/oe/auth/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package auth

// ConsumerAssertion represents the parsed and validated M2M token claims.
type ConsumerAssertion struct {
ApplicationID string // Mapped from 'application_id'
ApplicationID string // Mapped from validated 'client_id' (application identity)
ClientID string // Mapped from 'client_id'
Subscriber string // Mapped from 'sub' or 'azp'
Iss string // Mapped from 'iss'
Expand Down
1 change: 1 addition & 0 deletions internal/oe/federator/federator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ func TestSchemaCollection(t *testing.T) {
assert.NoError(t, err, tt.description)
assert.NotNil(t, response, "Response should not be nil")
assert.EqualValues(t, response.ProviderFieldMap, tt.expectedFields, "Should contain field: %s", tt.expectedFields)
assert.Len(t, response.Arguments, tt.expectedArgs, "Should extract expected number of query arguments")
})
}
}
Expand Down
Loading