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
📊 Role Organization by Level
L0 - Micro/Solo (3 roles)
| Role | Code | Endpoints | Description |
|---|---|---|---|
| Owner | OWNER | 15 | Full system access |
| Cashier | CASHIER | 7 | POS operations |
| Viewer | VIEWER | - | Read-only reports |
L1 - SME (6 roles)
| Role | Code | Endpoints | Description |
|---|---|---|---|
| Owner & Manager | OWN-MGR | - | Business owner |
| Finance Manager | FIN-MGR | 9 | Finance & reports |
| Inventory Manager | INV-MGR | 8 | Stock management |
| HR Manager | HR-MGR | 8 | HR & payroll |
| Cashier | CSH | - | Daily transactions |
| Auditor | AUD | 7 | Audit trail (read-only) |
L2 - Enterprise (24 roles)
- Management
- Finance
- Operations
- Marketing & CRM
- Support
- ADM-BIZ: Business configuration
- ADM-SYS: System infrastructure (7 endpoints)
L3 - Holding (9 roles)
| Role | Description |
|---|---|
| OWN-MGR-HLD | Owner & Manager (Holding) |
| CONS-MGR | Consolidation Manager |
| AUD-GRP | Group Auditor |
| BI-MGR | BI Manager |
| DATA-ANL | Data Analyst |
| + 4 more |
L4 - Corporate/MNC (15 roles)
| Role | Description |
|---|---|
| BOARD-CXO | Board & C-Level |
| GOV-COMP | Governance & Compliance |
| FIN-GLB | Global Finance |
| IT-SYS-GLB | Global IT System |
| ESG-MGR | ESG Manager |
| SEC-OFFR | Security Officer |
| + 9 more |
🚀 Quick Start
1. Open Bruno
2. Configure Environment
Create environment di Bruno dengan variables:3. Login & Get Token
- Navigate ke role folder yang sesuai (e.g.,
Role_L0_OWNER) - Run
001_AUTH_LOGIN.brudengan credentials valid - Copy JWT token dari response
- 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
Environment Management
Environment Management
- Pisahkan environment untuk Dev, Staging, Production
- Jangan commit auth_token ke version control
- Rotate tokens secara berkala
- Gunakan environment presets untuk switching cepat
Request Organization
Request Organization
- 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
Testing Strategy
Testing Strategy
- 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
Team Collaboration
Team Collaboration
- Share collection via Git
- Document expected responses
- Add pre-request scripts untuk setup
- Add tests untuk automated validation
📚 Related Documentation
RBAC Multi-Level
RBAC Architecture (L0-L4)
Endpoint Registry
Complete endpoint definitions
API Styleguide
API design patterns
🔄 Next Steps
For Developers
- Complete Endpoint Population: Add endpoints untuk role-role yang belum terisi
- Add Test Scripts: Implementasi automated tests di Bruno
- Add Pre-request Scripts: Setup data sebelum request
- Document Edge Cases: Tambahkan scenario error handling
For QA
- Create Test Suites: Group endpoints by feature
- Add Assertions: Validate response structure & data
- Performance Testing: Test endpoint response time
- Security Testing: Validate RBAC enforcement
For Product
- Review Role Permissions: Pastikan role sesuai use case
- Test User Flows: Validate end-to-end scenarios
- 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