-
Notifications
You must be signed in to change notification settings - Fork 5
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
Openfga relation interface update 01 #12
Openfga relation interface update 01 #12
Conversation
ae66259
to
ca41991
Compare
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.
Some things to address but otherwise looks good.
self.state = PeerRelationState(self.model, self.app, "openfga-peer") | ||
port_http = ServicePort(8080, name=f"{self.app.name}-http", protocol="TCP") | ||
port_grpc = ServicePort(8081, name=f"{self.app.name}-grpc", protocol="TCP") | ||
self.service_patcher = KubernetesServicePatch(self, [port_http, port_grpc]) |
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.
I think Ali might have a way of handling multiple ingress ports without the K8ServicePatch now. Something for the future.
return | ||
|
||
if not self._state.token_secret_id: | ||
token = secrets.token_urlsafe(32) |
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.
What is this 32 bit? Should we make it a constant so it has a name?
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.
i don't know.. it think this is ok
|
||
self._create_token_secret(event) | ||
|
||
# Quickly update logrotates config each workload update |
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.
It's python so arguably it won't be running quickly.
984dca5
to
4342f9c
Compare
logger.info("created token secret {}".format(secret.id)) | ||
|
||
@must_be_leader | ||
@requires_state |
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.
Really like the decorators, very nice.
Oh and gentle reminder about committing without |
- uses secrets to transfer tokens via relations - updated to use the new state implementation
4342f9c
to
e42aed7
Compare
…rface-update-01 Openfga relation interface update 01
Description
The what and why - include a summary of the change, describe what it does, and include relevant motivation and context.
Fixes JIRA/GitHub issue number
Engineering checklist
Check only items that apply
Test instructions
Notes for code reviewers