Skip to main content

Bruno API Collection - Role-Based Organization

Bruno API collection untuk MStore API V2 dengan struktur role-based mengikuti RBAC Multi-Level Architecture (L0-L4).

🎯 Overview

Collection ini memudahkan testing API berdasarkan role yang spesifik. Setiap role memiliki folder terpisah dengan endpoints yang sesuai dengan permissions role tersebut.

📁 Collection Structure

Total: 57 role folders covering L0-L4 business levels

📊 Role Organization by Level

L0 - Micro/Solo (3 roles)

L1 - SME (6 roles)

L2 - Enterprise (24 roles)

  • ADM-BIZ: Business configuration
  • ADM-SYS: System infrastructure (7 endpoints)

L3 - Holding (9 roles)

L4 - Corporate/MNC (15 roles)


🚀 Quick Start

1. Open Bruno

Open folder ini di Bruno application.

2. Configure Environment

Create environment di Bruno dengan variables:

3. Login & Get Token

  1. Navigate ke role folder yang sesuai (e.g., Role_L0_OWNER)
  2. Run 001_AUTH_LOGIN.bru dengan credentials valid
  3. Copy JWT token dari response
  4. Set token ke environment variable auth_token

4. Test Endpoints

Run endpoints lain sesuai dengan role permissions.

📂 Folder Structure per Role

Setiap role folder berisi:

File Format Example

}

Staging

Production


📋 Testing Workflow

1. Basic Flow (OWNER)

2. Transaction Flow (CASHIER)

3. Audit Flow (AUDITOR)


🎓 Best Practices

  • Pisahkan environment untuk Dev, Staging, Production
  • Jangan commit auth_token ke version control
  • Rotate tokens secara berkala
  • Gunakan environment presets untuk switching cepat
  • Group requests by domain (Core, Finance, Inventory, dll)
  • Beri naming yang konsisten (e.g., 001_, 002_)
  • Tambahkan docs lengkap di setiap request
  • Tambahkan sample response
  • Start dengan AUTH_LOGIN untuk setiap role
  • Test positive cases dulu, baru negative cases
  • Validate response schema
  • Check RBAC permissions enforcement
  • Test SoD (Segregation of Duties) rules
  • Share collection via Git
  • Document expected responses
  • Add pre-request scripts untuk setup
  • Add tests untuk automated validation

RBAC Multi-Level

RBAC Architecture (L0-L4)

Endpoint Registry

Complete endpoint definitions

API Styleguide

API design patterns

🔄 Next Steps

For Developers

  1. Complete Endpoint Population: Add endpoints untuk role-role yang belum terisi
  2. Add Test Scripts: Implementasi automated tests di Bruno
  3. Add Pre-request Scripts: Setup data sebelum request
  4. Document Edge Cases: Tambahkan scenario error handling

For QA

  1. Create Test Suites: Group endpoints by feature
  2. Add Assertions: Validate response structure & data
  3. Performance Testing: Test endpoint response time
  4. Security Testing: Validate RBAC enforcement

For Product

  1. Review Role Permissions: Pastikan role sesuai use case
  2. Test User Flows: Validate end-to-end scenarios
  3. Document Workflows: Update user guides

📞 Support

Jika ada pertanyaan atau butuh bantuan:
  • Documentation: Check /80-guides/rbac-multilevel-architecture
  • Endpoint Registry: /config/api/endpoints-registry-v2.yaml
  • RBAC Policy: /config/rbac/policy.csv

Tags: bruno, api-testing, rbac, role-based, collection, testing-tools