Skip to content

Commit

Permalink
add hack attr route
Browse files Browse the repository at this point in the history
  • Loading branch information
strantalis committed Nov 10, 2023
1 parent d5e3011 commit e703622
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions api/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ func LoadAttributeRoutes(db *db.Client) chi.Router {
return r
}

// TODO: This is a hack to allow KAS to resolve attributes
func LoadAttributeRoutesHack(db *db.Client) chi.Router {
attr := attributes.NewClient(db)
a := attrClient{attr}
r := chi.NewRouter()
r.Get("/", a.getDefinitions)
return r
}

func (a attrClient) getAttributes(w http.ResponseWriter, r *http.Request) {
// TODO
}
Expand Down
1 change: 1 addition & 0 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func start(cmd *cobra.Command, args []string) {
r.Mount("/entitlements", api.LoadEntitlementRoutes(dbClient))
})
})
r.Mount("/v1/attrName", api.LoadAttributeRoutesHack(dbClient))
r.Route("/healthz", func(r chi.Router) {
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
Expand Down
4 changes: 2 additions & 2 deletions pkg/entitlements/entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
)

type Client struct {
db *db.Client
opa *sdk.OPA
db *db.Client
// opa *sdk.OPA
}

func NewClient(db *db.Client) Client {
Expand Down

0 comments on commit e703622

Please sign in to comment.