frontier
frontier copied to clipboard
refactor: api http statuscode
- Add
mockeryfor mocking interface - For APIs that require Auth Email header, return 403 Forbidden if not present/user does not exist
- Fix error type naming
- Create a function to check empty string
- Add tests in handler
Pull Request Test Coverage Report for Build 2880992908
- 356 of 447 (79.64%) changed or added relevant lines in 22 files are covered.
- 16 unchanged lines in 3 files lost coverage.
- Overall coverage increased (+20.03%) to 70.913%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| internal/api/v1beta1/policy.go | 9 | 10 | 90.0% |
| internal/api/v1beta1/project.go | 43 | 45 | 95.56% |
| internal/store/postgres/action_repository.go | 6 | 8 | 75.0% |
| internal/store/postgres/relation_repository.go | 10 | 12 | 83.33% |
| internal/api/v1beta1/group.go | 77 | 80 | 96.25% |
| internal/api/v1beta1/org.go | 31 | 35 | 88.57% |
| internal/store/postgres/namespace_repository.go | 5 | 9 | 55.56% |
| internal/store/postgres/role_repository.go | 7 | 11 | 63.64% |
| internal/store/postgres/organization_repository.go | 9 | 15 | 60.0% |
| internal/store/postgres/project_repository.go | 7 | 13 | 53.85% |
| <!-- | Total: | 356 | 447 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| internal/api/v1beta1/permission_check.go | 2 | 0% |
| internal/api/v1beta1/user.go | 2 | 81.12% |
| internal/store/postgres/resource_repository.go | 12 | 76.02% |
| <!-- | Total: | 16 |
| Totals | |
|---|---|
| Change from base Build 2866460769: | 20.03% |
| Covered Lines: | 3357 |
| Relevant Lines: | 4734 |
💛 - Coveralls
Need to hold this until v0.3.x is stable enough
This can be reviewed