canonical / identity-platform-admin-ui

Admin UI for the Canonical identity broker and identity provider solution
Other
6 stars 4 forks source link

(ReBAC library) Initialize ReBAC Admin UI Backend library #194

Closed babakks closed 6 months ago

babakks commented 6 months ago

This PR creates a separate Go module encompassing the *ReBAC Admin UI Backend` library. Essentially, this library implements HTTP handlers according to the ReBAC Admin UI OpenAPI spec and delegates the actual operation (authorization or manipulating OpenFGA tuples) to custom implementations plugged in via pre-defined interfaces.

Since the library is meant to be a reusable component and will later be extracted into a separate repository, we try to keep it as a separate/independent Go module. Note that, to make it play nice with the main Go module in the repo's root, we had to use Go Workspaces. After the library is extracted, we can delete the Go Workspace.

Fixes CSS-7248

shipperizer commented 6 months ago

@babakks can u rewrite the commits to follow the conventional commits standard?

reason is that our release process uses those for drafting a release

babakks commented 6 months ago

@babakks can u rewrite the commits to follow the conventional commits standard?

reason is that our release process uses those for drafting a release

Yeah, sure. I usually try keeping my commits as small as possible, so at times it might be a bit difficult to pick/find an accurate commit message type (e.g., fix or feat). But I'll do my best.

shipperizer commented 6 months ago

@babakks can u rewrite the commits to follow the conventional commits standard?

reason is that our release process uses those for drafting a release

Yeah, sure. I usually try keeping my commits as small as possible, so at times it might be a bit difficult to pick/find an accurate commit message type (e.g., fix or feat). But I'll do my best.

don't sweat it, just put fix if it s a minor change or chore if u think it s irrelevant

babakks commented 6 months ago

@alesstimec @shipperizer Sorry for the --force push.

babakks commented 6 months ago

I removed the OpenAPI spec copy, and now we have it embedded within the auto-generated types.

babakks commented 6 months ago

I also removed the Go Workspace because it causes some conflicts with the other parts of the repository (e.g., go generate directives with -mod=mod option). Since we don't want to touch other parts of the repo for this library, we'd better off keeping the library as a package inside the main Go module.

babakks commented 6 months ago

Just one more update. I also generated the server part (handlers and routes). I think it's done now and we can merge it if it's okay with you. @alesstimec @shipperizer

babakks commented 6 months ago

UPDATE: The /swagger.json endpoint is now added to the ReBAC Admin OpenAPI spec.

babakks commented 6 months ago

Reworded the commits. Please have a look. @shipperizer

shipperizer commented 6 months ago

@babakks I think u forgot to force push, there are still 31 commits instead of 3

babakks commented 6 months ago

Sorry, I thought your suggesting commit message rewording. I'll rebase and push with 3 or so commits.

babakks commented 6 months ago

@shipperizer Done.