Read-Only Integration Test Plan¶
Document status: Planned verification
Verification status: Execution evidence pending
Scope: Gmail, Google Drive, Google Calendar, Jira, Slack, and Microsoft Teams
1. Purpose¶
This document defines the test scenarios, verification procedures, and acceptance criteria required to validate WhiteLotusAI's integrations in strict read-only mode.
The objective is to demonstrate that:
- Approved read operations return only data authorized for the requesting user.
- Write-capable operations are rejected at the appropriate server-side enforcement boundaries.
- Authentication, authorization, OAuth, and credential handling fail safely.
- Provider errors, malformed inputs, and dependency failures do not compromise security or expose sensitive information.
- Verification results are reproducible, traceable, and tied to a specific application version.
This document is a test plan, not evidence of implementation or successful execution. A requirement must not be considered verified solely because it appears in this document.
2. Scope and Boundaries¶
2.1 Integrations in scope¶
| Integration | Primary verification focus |
|---|---|
| Gmail | Email search, messages, threads, labels, attachments, and mutation prevention |
| Google Drive | File search, metadata, folders, permissions, and mutation prevention |
| Google Calendar | Event retrieval, date-range validation, and event mutation prevention |
| Jira | Project and issue retrieval, query validation, and issue mutation prevention |
| Slack | Channel discovery, message history, rate limits, and message mutation prevention |
| Microsoft Teams | Teams, channels, messages, members, OAuth, and token resolution |
The plan also covers tool registration and dispatch, direct integration API access, internal service authentication, user isolation, OAuth security, input validation, error handling, and security-relevant logging.
2.2 Out of scope¶
- Implementing application-code changes.
- Introducing new integration capabilities or broader OAuth scopes.
- Using production credentials or real customer data.
- Performing live write operations to demonstrate that writes should be blocked.
- Declaring production readiness without supporting test and deployment evidence.
3. Test Status and Evidence¶
Verification has not yet been established
All scenarios in this document are planned until execution evidence is recorded. Do not interpret the presence of a test case as proof that the corresponding control exists or works.
Use the following status values consistently:
| Status | Meaning |
|---|---|
Not Run |
Execution has not started. |
Passed |
The expected result was observed and supported by evidence. |
Failed |
Observed behavior did not satisfy the acceptance criteria. |
Blocked |
Execution could not proceed because of a documented dependency, environment, or credential limitation. |
A blocked test is not a pass. An unavailable test dependency must not be silently treated as successful verification.
4. Test Environment and Safety Controls¶
Execute the plan only in an isolated development or test environment.
4.1 Pre-execution checklist¶
- Use dedicated test accounts and synthetic or approved test data.
- Confirm that production credentials and customer records are not being used.
- Identify the application commit, build, and configuration under test.
- Review manual scripts and test fixtures for external side effects.
- Confirm that write-operation tests use mocks, controlled provider fixtures, or an isolated test tenant.
- Verify that rejected write operations cannot reach the provider's mutation endpoint.
- Ensure test logs, screenshots, and reports redact credentials and sensitive content.
- Record missing dependencies and environmental limitations before execution.
Do not test write prevention by mutating real resources
Do not send messages, create or modify issues, change calendar events, alter file permissions, or perform other writes against real external accounts. Prefer mocked provider clients and instrumented test doubles that fail the test if a mutation method is invoked.
4.2 Required test layers¶
| Layer | Purpose | Suggested verification method |
|---|---|---|
| Unit | Validate policy decisions and input handling | Unit tests with mocked dependencies |
| Tool dispatch | Validate registered-tool selection and policy enforcement | Dispatcher tests and registry inspection |
| API | Validate server-side authorization and route behavior | Isolated integration tests |
| Provider adapter | Validate request construction and error mapping | Mocked HTTP responses or provider fixtures |
| OAuth and credentials | Validate state, identity, expiry, and token handling | Controlled callback and token-store tests |
| Regression | Prevent recurrence of identified defects | Repeatable automated tests |
The suggested methods are test-design recommendations. Use only commands, fixtures, and test infrastructure that actually exist in the repository or have been deliberately created for the test environment.
5. Verification Workflow¶
The following workflow describes the expected verification process. It does not imply that these stages have already been executed.
flowchart TD
A["Identify application version"] --> B["Prepare isolated test environment"]
B --> C["Review test prerequisites and safety"]
C --> D["Execute functional read tests"]
D --> E["Execute write-prevention tests"]
E --> F["Verify identity, OAuth, and authorization"]
F --> G["Exercise failure and regression scenarios"]
G --> H{"Evidence meets acceptance criteria?"}
H -- "No" --> I["Record failure or blocked status"]
I --> J["Create or update defect record"]
J --> G
H -- "Yes" --> K["Review evidence and outstanding risks"]
K --> L{"All exit criteria satisfied?"}
L -- "No" --> I
L -- "Yes" --> M["Record version-scoped verification result"]
classDef process fill:#e8efff,stroke:#5678b8,color:#172b4d
classDef decision fill:#fff0d6,stroke:#b7791f,color:#633c08
classDef outcome fill:#dff5e8,stroke:#26845b,color:#164b35
class A,B,C,D,E,F,G,I,J,K process
class H,L decision
class M outcome
The diagram uses explicit node colors for readability. If the documentation renderer does not provide sufficient contrast in both themes, remove the classDef and class lines while retaining the workflow.
6. Common Test Scenarios¶
Each scenario must be executed against the appropriate enforcement boundary. Where a scenario applies to several integrations, record results separately for each applicable provider.
| ID | Scenario | Acceptance criteria |
|---|---|---|
| RO-001 | Connected user performs an approved read | Only authorized data belonging to that user is returned. |
| RO-002 | User requests a write through chat | The operation is rejected under the strict read-only policy. |
| RO-003 | Client directly invokes a write-capable API route | Server-side enforcement rejects the request independently of frontend controls. |
| RO-004 | Write-capable tool receives confirmation metadata | Confirmation metadata cannot override the read-only policy. |
| RO-005 | Request lacks required user identity or internal authentication | Access is denied safely. |
| RO-006 | User A attempts to access User B's integration data | Access is denied without disclosing User B's data. |
| RO-007 | Integration is disconnected | The request fails with a controlled connection error. |
| RO-008 | Access token expires | The documented refresh flow succeeds, or the request fails safely. |
| RO-009 | Provider returns an error or times out | A controlled error is returned without exposing credentials or internal secrets. |
| RO-010 | Request contains malformed identifiers or unsupported input | Input is rejected or handled safely without unintended side effects. |
| RO-011 | Result limit exceeds the approved maximum | The request is rejected or bounded according to the documented API contract. |
| RO-012 | Provider returns malformed or unexpected data | The application handles the failure safely without leaking internal details. |
| RO-013 | Automated or manual test fails | The failure is recorded and cannot be silently counted as a pass. |
| RO-014 | Request targets a different connected provider | Dispatch uses only the explicitly authorized provider and user connection. |
6.1 Write-prevention enforcement matrix¶
Write prevention must be tested at every applicable layer rather than inferred from the user interface.
| Enforcement boundary | Verification | Required outcome |
|---|---|---|
| Intent and planning | Request a prohibited mutation through chat | No authorized execution plan for the mutation is produced. |
| Tool registry and dispatch | Attempt to resolve or invoke a prohibited tool | The operation is rejected before provider execution. |
| Integration API | Call the relevant route directly | Server-side policy denies the mutation. |
| Provider adapter | Instrument mutation methods in a test double | No mutation method is called for a rejected request. |
| Credentials and permissions | Inspect applicable scopes and provider permissions | Least privilege is maintained; provider permissions supplement, rather than replace, application enforcement. |
A successful chat-level rejection does not prove that a direct API route is protected. Likewise, a missing frontend control is not evidence that a server-side authorization check exists.
7. Integration-Specific Test Scenarios¶
7.1 Gmail¶
| ID | Scenario | Acceptance criteria |
|---|---|---|
| GMAIL-T01 | Search email by sender, subject, and date | Results match the supported query semantics and authorization context. |
| GMAIL-T02 | Retrieve inbox messages, individual messages, and threads | Returned records belong to the authenticated user. |
| GMAIL-T03 | Retrieve labels and inbox statistics | Empty and populated mailboxes are handled correctly. |
| GMAIL-T04 | List or download an attachment | Access is authorized; missing or invalid attachments fail safely. |
| GMAIL-T05 | Request send, draft, reply, or forward operations | Every applicable mutation is blocked before provider execution. |
| GMAIL-T06 | Request label changes, read-state changes, archive, star, or trash | Every applicable mutation is blocked before provider execution. |
| GMAIL-T07 | Use a disconnected account or invalid credentials | No unauthorized Gmail data is returned. |
| GMAIL-T08 | Submit malformed searches or excessive query limits | Inputs are validated and requests remain bounded. |
7.2 Google Drive¶
| ID | Scenario | Acceptance criteria |
|---|---|---|
| DRIVE-T01 | Search files by query, type, or date | Results respect the connected user's permissions. |
| DRIVE-T02 | Retrieve file metadata and list folders | Only authorized resources are returned. |
| DRIVE-T03 | Inspect file permissions | Returned permission information is authorized and appropriately scoped. |
| DRIVE-T04 | Request folder or file creation | The operation is blocked before provider execution. |
| DRIVE-T05 | Request move, rename, copy, trash, or star operations | Every applicable mutation is blocked. |
| DRIVE-T06 | Request sharing or permission removal | The operation is blocked. |
| DRIVE-T07 | Use an account without a valid connection | Access fails safely without cross-user fallback. |
7.3 Google Calendar¶
| ID | Scenario | Acceptance criteria |
|---|---|---|
| GCAL-T01 | List events over an approved time range | Only authorized calendar events are returned. |
| GCAL-T02 | Query empty and populated date ranges | Both outcomes are handled consistently. |
| GCAL-T03 | Submit invalid dates or excessive result limits | Inputs are rejected or bounded according to the API contract. |
| GCAL-T04 | Request event creation | The operation is blocked before provider execution. |
| GCAL-T05 | Request event deletion or modification | The operation is blocked. |
| GCAL-T06 | Use an expired token or inactive connection | Token refresh follows the documented flow or fails safely. |
7.4 Jira¶
| ID | Scenario | Acceptance criteria |
|---|---|---|
| JIRA-T01 | List authorized projects | Only projects accessible to the connected account are returned. |
| JIRA-T02 | Search issues using supported filters | Results match the supported query semantics and permissions. |
| JIRA-T03 | Retrieve an issue | The result is authorized and correctly associated with the requested issue. |
| JIRA-T04 | Request issue creation or modification | The operation is blocked before provider execution. |
| JIRA-T05 | Submit invalid project or issue identifiers | Errors are controlled and do not expose sensitive configuration. |
| JIRA-T06 | Exercise approved OAuth and environment-based authentication paths | Only explicitly approved authentication paths are usable. |
7.5 Slack¶
| ID | Scenario | Acceptance criteria |
|---|---|---|
| SLACK-T01 | List channels | Results are limited to channels accessible to the authorized user or app identity. |
| SLACK-T02 | Retrieve channel history | Results respect channel authorization and approved limits. |
| SLACK-T03 | Request message sending or other mutations | The operation is blocked before provider execution. |
| SLACK-T04 | Query archived channels and empty history | Results follow documented provider and application behavior. |
| SLACK-T05 | Exercise rate limits and upstream errors | Errors are controlled and applicable retry guidance is respected. |
| SLACK-T06 | Test missing credentials and shared-token fallback | Unauthorized shared-account access is prevented. |
7.6 Microsoft Teams¶
| ID | Scenario | Acceptance criteria |
|---|---|---|
| TEAMS-T01 | List teams and channels | Results are limited to resources available to the authorized account. |
| TEAMS-T02 | Retrieve messages and user information | Returned data is authorized and correctly associated with the request. |
| TEAMS-T03 | List team members | Access respects provider permissions and approved scopes. |
| TEAMS-T04 | Search messages | Supported search semantics and permission requirements are verified. |
| TEAMS-T05 | Request message sending or other mutations | The operation is blocked before provider execution. |
| TEAMS-T06 | Exercise OAuth state, callback, and token refresh | Invalid state and failed authentication are handled safely. |
| TEAMS-T07 | Exercise token resolution and fallback paths | Token handling does not bypass expiry or user-isolation requirements. |
| TEAMS-T08 | Compare frontend catalogue status with observed behavior | Any readiness claim is supported by version-specific test evidence. |
8. OAuth and Credential Security¶
Apply the following scenarios to each integration that uses OAuth or equivalent delegated credentials. Tailor the tests to the actual authorization flow and provider requirements.
| ID | Scenario | Acceptance criteria |
|---|---|---|
| AUTH-001 | Missing or invalid OAuth state | Callback is rejected safely. |
| AUTH-002 | Expired OAuth state | Expired authorization attempts are rejected. |
| AUTH-003 | Replayed callback request | Replay is rejected where required by the flow's security design. |
| AUTH-004 | Invalid or expired authorization code | Token exchange fails safely. |
| AUTH-005 | Revoked or invalid refresh token | Access fails safely and follows the documented reconnection flow. |
| AUTH-006 | Token refresh fails | No unauthorized fallback or disclosure occurs. |
| AUTH-007 | Token persistence fails | The application does not report a connection as successfully established without the required persistence. |
| AUTH-008 | Internal service credential is missing or invalid | The internal request is denied. |
| AUTH-009 | User identity does not match the stored connection | The connection cannot be used to access another user's data. |
| AUTH-010 | Provider returns an unexpected authorization response | The application fails safely without exposing tokens or authorization codes. |
| AUTH-011 | PKCE is required by the configured flow | The applicable verifier and challenge checks satisfy the provider's requirements. |
OAuth state validation, PKCE, and callback replay controls must be assessed according to the actual flow. Do not assume that every provider or authorization path uses identical mechanisms.
9. Input Validation, Reliability, and Information Security¶
In addition to the scenario tables above, verify the following controls.
9.1 Input and resource bounds¶
- Missing, empty, malformed, or excessively long identifiers.
- Unsupported search operators and invalid query syntax.
- Invalid date ranges and inconsistent pagination parameters.
- Zero, negative, nonnumeric, or excessive result limits.
- Oversized attachment downloads or unexpected content types, where applicable.
- Provider responses containing missing fields, unexpected types, or invalid encodings.
Acceptance requires deterministic validation or controlled failure, bounded resource use, and no unintended external side effects.
9.2 Reliability and dependency failures¶
- Provider connection timeouts and request failures.
- HTTP throttling and provider rate-limit responses.
- Internal database, cache, and message-broker failures where relevant to the request path.
- Token-store failures during lookup, refresh, or persistence.
- Repeated failures and retry behavior.
- Cancellation or interrupted requests, where supported.
Retries must not convert a rejected mutation into an executable operation. Retry behavior must be bounded and consistent with the applicable provider guidance.
9.3 Security and observability¶
- Verify that access tokens, refresh tokens, authorization codes, and internal secrets are not exposed in responses or logs.
- Verify that error responses do not reveal stack traces, database details, or internal service credentials.
- Verify that security-relevant events can be correlated with a request or test identifier without logging unnecessary message or document content.
- Verify that authorization failures do not reveal whether another user's private resource exists, beyond what the documented API intentionally discloses.
- Verify that failure status is observable and accurately represented in test reports.
10. Test Execution and Evidence Record¶
10.1 Required evidence fields¶
Record one entry for every executed scenario.
| Field | Required information |
|---|---|
| Test ID | Stable identifier from this plan |
| Application version | Commit SHA, release identifier, or build ID |
| Environment | Isolated environment and relevant configuration identifier |
| Preconditions | Account, connection, permissions, and synthetic test data |
| Execution | Actual command or reproducible test steps |
| Expected result | Acceptance criterion from the plan |
| Actual result | Observed behavior and relevant assertions |
| Status | Not Run, Passed, Failed, or Blocked |
| Evidence | Sanitized logs, assertion output, or report reference |
| Defect reference | Issue ID for failures or follow-up work |
| Reviewer | Person responsible for reviewing the evidence, where applicable |
10.2 Example test-result record¶
The following YAML is a template only. Replace the placeholders with actual execution data before using it as evidence.
test_id: RO-003
application_version: "<commit-sha-or-build-id>"
environment: "<isolated-test-environment>"
preconditions:
- "Dedicated test account configured"
- "Provider mutation endpoint instrumented or mocked"
execution:
command: "<actual-test-command>"
expected_result: "Direct write request is rejected server-side."
actual_result: "<observed-result>"
status: "Not Run"
evidence:
- "<sanitized-test-report-or-log-reference>"
defect_reference: null
reviewer: "<reviewer-or-pending>"
Do not fabricate observed results, report links, commit identifiers, or reviewer approvals.
10.3 Suggested execution commands¶
Use the repository's actual test configuration and installed tooling. The following commands are illustrative examples, not assertions that the project exposes these exact test paths or scripts.
Only record commands that were actually executed. A successful test-runner exit code alone is insufficient if the relevant test was skipped, did not execute, or failed to assert the intended security property.
11. Exit Criteria¶
Strict read-only mode must not be declared verified until all applicable criteria below are satisfied.
- Approved read-operation tests pass for the six integrations in scope.
- Identified write-capable operations are blocked through applicable tool-dispatch and direct API paths.
- Tests confirm that rejected mutations do not reach provider mutation methods.
- Authentication, authorization, and cross-user isolation tests pass.
- Applicable OAuth, token refresh, and credential persistence tests pass.
- Input validation, result bounds, and failure-handling tests pass.
- Security-relevant logs and error responses meet project requirements.
- Relevant regression tests pass.
- Every failure and blocked test has a documented disposition.
- Evidence is reviewed and corresponds to the application version proposed for release.
A test that is inapplicable must have a documented rationale. A blocked or failed critical security test must not be treated as satisfying an exit criterion without an explicit, approved risk decision.
Release decision
Verification may be recorded only after the responsible reviewer confirms that the required evidence is complete, the applicable exit criteria are satisfied, and unresolved risks have been documented. This is a decision gate, not a claim that the gate has already been passed.
12. Maintenance and Change Control¶
Review this plan whenever any of the following changes:
- Integration tools, registry entries, or dispatch behavior.
- API routes or authorization enforcement.
- OAuth scopes, callback handling, or token lifecycle management.
- Provider permissions or credential-resolution behavior.
- Read-only requirements, supported operations, or result limits.
- Logging, error handling, or security-sensitive dependencies.
When a defect is fixed, add or update a regression test that demonstrates the required behavior. Keep implementation changes, test evidence, and documentation changes separately traceable.
Re-evaluate previously passed tests when relevant code, dependencies, permissions, or deployment configuration changes.
13. Related Documentation¶
Link these references to their actual repository paths when the corresponding documents are available:
- Security Overview
- Threat Model
- Read-Only Integration Security Policy
- Testing Strategy
- Test Cases
- Test Inventory
Verification principle: A documented control is a requirement. An executed test with reproducible evidence is verification. A release decision requires both the relevant evidence and a documented review.