-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include auth model in OCI image #1212
Conversation
Dockerfile
Outdated
@@ -21,6 +21,7 @@ LABEL org.opencontainers.image.source=https://github.com/canonical/jimm | |||
LABEL org.opencontainers.image.description="JIMM server container image" | |||
RUN apt-get -qq update && apt-get -qq install -y ca-certificates postgresql-client | |||
WORKDIR /root/ | |||
COPY --from=build-env /usr/src/jimm/local/openfga/authorisation_model.json . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: I have a feeling that grouping OpenFGA-related files (which at the moment, it's just this one) in a separate directory (e.g., /openfga
) could be beneficial some day in the future. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's a good idea, I'll make an openfga
folder inside /root/
Dockerfile
Outdated
RUN mkdir ./openfga | ||
COPY --from=build-env /usr/src/jimm/openfga/authorisation_model.json ./openfga/ | ||
COPY --from=build-env /usr/src/jimm/jimmsrv . | ||
COPY --from=build-env /usr/src/jimm/internal/dbmodel/sql ./sql/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to mkdir
? Because for the SQL files (the last line) it just works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
Description
I'd like to propose an improvement to JIMM's deployment. The OpenFGA authorisation model is tightly coupled to JIMM's codebase i.e. there are several Go types defined based on the types in the auth model.
Currently the JIMM charm creates the auth model from user input, if the auth model supplied by the user is not the same as the one JIMM was tested against, things will break. This change would add the auth model as a file to the OCI image and in a separate PR to the charm, allow the charm to read the auth model and create it rather than using error-prone user input.
Fixes CSS-8463