Commit dbde71a
authored
refactor(acl): migrate to shared ACL client and add GetObject handler (#322)
**Because**
- The ACL client implementation was duplicated across multiple backend
services
- OpenFGA cache configuration needs to be explicit for consistent
behavior
- The `GetObject` API endpoint was missing from the handler
- Resource ID generation utilities were duplicated and should use the
shared library
- Pipeline release operations needed to handle OUTPUT_ONLY slug field
correctly
**This commit**
- Refactors `pkg/acl/acl.go` to use the shared ACL client from
`github.com/instill-ai/x/acl`, reducing ~350 lines of duplicate OpenFGA
client logic
- Adds OpenFGA cache configuration in `config/config.yaml` with
`enabled: false` and `ttl: 60`
- Adds cache configuration struct to `config/config.go` to support the
new OpenFGA cache settings
- Implements `GetObject` handler in `pkg/handler/object.go` for
retrieving object details by AIP-compliant name
- Adds `GetObjectByID` method to `pkg/service/object.go` for
service-layer object lookup
- Refactors `pkg/utils/utils.go` to use shared
`resource.GenerateResourceID` from x package instead of duplicated
base62 encoding logic
- Updates `pkg/pipeline/release.go` to handle OUTPUT_ONLY `Slug` field:
- Removes setting `Slug` on Pipeline creation (server-generated from
DisplayName)
- Lists releases to find existing by slug instead of direct ID lookup
- Adds `DisplayName` field to PipelineRelease
- Updates various handlers and workers to align with refactored ACL
client interface
- Updates dependencies:
- `protogen-go`: updated to latest alpha with flattened packages
- `x`: updated to latest with shared ACL client and resource utilities1 parent 487d4f7 commit dbde71a
File tree
26 files changed
+313
-567
lines changed- .github/workflows
- config
- pkg
- acl
- ai/gemini
- handler
- pipeline
- repository
- object
- service
- utils
- worker
26 files changed
+313
-567
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| |||
0 commit comments