# Test Tools Repository

Scaffold a personal test tools repository to manage non-prod role assignments, external test users, and JWT token generation pipelines.

[TOC]

---

## 📋 Overview

| Aspect            | Details                                                                         |
| ----------------- | ------------------------------------------------------------------------------- |
| **Goal**          | Create a personal test tools repository using the `saif-test-tools` template   |
| **Prerequisites** | SAIF CLI installed                                                              |
| **Time estimate** | ~5 minutes                                                                      |
| **Difficulty**    | Beginner                                                                        |

---

## 🎯 What Is a Test Tools Repository?

A test tools repository is a personal Azure DevOps repository scaffolded from the `saif-test-tools` template. It provides three capabilities:

| Capability                  | Description                                                                          |
| --------------------------- | ------------------------------------------------------------------------------------ |
| **Non-prod role assignment** | Assign yourself to business roles in non-production environments via Terraform        |
| **External test users**     | Create and manage Okta test users for external (policyholder/provider) authentication |
| **Token generation**        | Generate OAuth 2.0 JWT tokens for API testing with Postman, Swagger, RestClient, etc. |

> 💡 **You only need one test tools repository per developer.** Once created, it serves all your projects.

---

## 🔧 Prerequisites

- ✅ SAIF CLI installed (`saif --version` to verify)

---

## 🚀 Instructions

### Scaffold and Publish the Repository

Run the `saif-test-tools` template:

```powershell
saif new saif-test-tools
```

The CLI will prompt you for:

- **Business domain** — select `it` (the only available option)
- **Application name** (your username or a personal identifier, e.g., `jsmith`)

The generated project ID follows the pattern: `it-test-tools-{application_name}` (e.g., `it-test-tools-jsmith`).

`saif new` automatically creates the Azure DevOps repository, pushes the scaffolded code, and registers all three pipelines for you.

---

## 📁 What Was Created

After scaffolding, your repository contains:

```
.azdo/
├── np-roles-pipeline.yml            # Non-prod role assignment pipeline
├── external-test-users-pipeline.yml # External test user management pipeline
├── gen-token-pipeline.yml           # JWT token generation pipeline
└── vars.yml                         # Shared pipeline variables

infra/
├── np-role-assignment-corp/
│   ├── my-roles.yml                 # Edit this file to assign roles to yourself
│   └── okta-nprole-assignment.generated.tf
└── test-user-maint-external/
    ├── bootstrap/
    │   └── bootstrap.generated.tf
    └── okta/
        ├── my-test-users.yml        # Edit this file to manage external test users
        └── external-test-users.generated.tf

README.md
```

---

## 🚀 Next Steps

| Task                         | Guide                                                               |
| ---------------------------- | ------------------------------------------------------------------- |
| Generate a JWT token         | [JWT Test Tokens](create-jwt-for-testing-apis.md)                   |
| Manage external test users   | [External Test Users](manage-external-test-users.md)                |
| Assign non-prod roles        | [Non-Production Role Assignment](non-production-role-assignment.md) |
| Migrate from Forge v2        | [Test Tools Migration (v2 to v3)](../../migration/test-tools-v2-to-v3.md) |
