You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Auth API: Add event to message queue when account removes own access to organization #27075
DBC Phase 2DependencyTo highlight the dependency(intra team, external, third parties)Entities TeamA label to filter on the tickets for the Entities based team that takes care of front end featuresPayWork for Pay Team
See #26682 for a discussion of this process and the requirements.
Is your feature request related to a problem? Please describe.
As part of the Digital Business card project, there is a requirement to trigger a credential revocation event when a user/account loses access to an organization.
Describe the solution you'd like
A pub/sub event is pushed onto the message queue as part of the API call responsible for removing access. The event will then be picked-up by the handler responsible for issuing/revoking credentials and trigger the revocation event.
Describe alternatives you've considered
N.A.
Additional context
As output from this, documentation on what event to listen to and what data payload to expect to determine WHO the event is related to would be required.
@seeker25@sandragornall As per 26682, is THIS the right solution, and are you able to work on it? It's blocking the DBC2 team. (In a pinch, the DBC2 could possible work on this ticket but I'm sure you could do it much faster!)
@OlgaPotiagalova has confirmed that this is part of DBC phase 2, so Pay needs to implement this queue message this PI. We will pull this in and estimate it.
A note to consider is that when an affiliation is broken, all users on that account lose access to the business. Our queue message will need to enumerate all the people that should have their DBC revoked for that particular business, or we can send a message about an account and DBC needs to look it up in AUTH. Just wanted to say this so we are all clear that affiliations take place between an account and a business, not an individual and a business. <-- does that sound OK Olga?
@JohnamLane, yes, it sounds right to me. Could you please provide estimates. This is a blocker for DBC Phase 2 release planned for the end of Apr. e would appreciate it if your team could help address this as soon as possible. Thank you.
I'll let @severinbeauvais and @thorwolpert chime in since I am not an expert about Registries' pub/sub architecture and existing setup.
From a requirement perspective, we need to pick up a notification when an account loses access to an organization. The payload needs to contain enough information to determine which account and organization the notification relates to - extra information may be useful, but that is the bare minimum.
If I understand things right this will be a new topic/subscription, it does not necessarily need to be specific to DBC though since this type of event may come in handy for other account-related triggers (possibly?).
@esune we have specific subscriptions per service if we want to know if the service is actioning the message, if not they go to a DLQ for some intervention. We do have open topics/subscriptions along the lines of, if you don't process it, it's not a worry.
We use CloudEvents as the envelope and put just enough data into the message that we can discern if we're interested in doing more with the event.
You'll have a better idea of what you need, but in order for Travis to bang this out we'll need to know what elements to add.
eg.
Circling back, I am not sure whether more information is needed to move forward, or we are just waiting for this to be scheduled/tackled - please let me know if you need me, a quick chat might be best as I am still familiarizing with the overall architecture/system.
in order for Travis to bang this out we'll need to know what elements to add
Emiliano, can you answer this?
I got an invite from @JohnamLane for thursday, I think we will sort this out then - I will likely have questions on what is available to be exposed as well.
@JohnamLane following-up on this to see if your team can provide us with some documentation/examples for the pub/sub APis and possibly mock data so we can start working on our end while we wait for the change to be developed/deployed for final end-to-end validation.
I just set up a test subscriber to make sure the messages were received, once we know the endpoint URL for the DBC listener we can set it up so it starts getting messages pushed to it.
DBC Phase 2DependencyTo highlight the dependency(intra team, external, third parties)Entities TeamA label to filter on the tickets for the Entities based team that takes care of front end featuresPayWork for Pay Team
Activity
severinbeauvais commentedon Apr 9, 2025
@seeker25 @sandragornall As per 26682, is THIS the right solution, and are you able to work on it? It's blocking the DBC2 team. (In a pinch, the DBC2 could possible work on this ticket but I'm sure you could do it much faster!)
seeker25 commentedon Apr 9, 2025
@JohnamLane -^
JohnamLane commentedon Apr 9, 2025
@OlgaPotiagalova has confirmed that this is part of DBC phase 2, so Pay needs to implement this queue message this PI. We will pull this in and estimate it.
A note to consider is that when an affiliation is broken, all users on that account lose access to the business. Our queue message will need to enumerate all the people that should have their DBC revoked for that particular business, or we can send a message about an account and DBC needs to look it up in AUTH. Just wanted to say this so we are all clear that affiliations take place between an account and a business, not an individual and a business. <-- does that sound OK Olga?
OlgaPotiagalova commentedon Apr 10, 2025
@JohnamLane, yes, it sounds right to me. Could you please provide estimates. This is a blocker for DBC Phase 2 release planned for the end of Apr. e would appreciate it if your team could help address this as soon as possible. Thank you.
seeker25 commentedon Apr 10, 2025
It's a couple hours work if the PUBSUB topic / subscription already exists. If it doesn't exist maybe a day or less to get it setup and done.
We'll need clear requirements for it though (exactly when to send the message).
What is the payload of the expected message? (probably the orgId / status?, might need a little discussion)
What are the exact business requirements for this message to be sent?
Which service is it hitting? Is there an existing pathway inside of here:
https://www.figma.com/file/ZLlmaQ5sCsBEkUxUtsETwQ/PUB%2FSUB-Queue-Mapping?type=whiteboard&node-id=0-1&t=b5mNV4giEuTJU28E-0
or is it something new? (New Topic, new subscription)
esune commentedon Apr 11, 2025
I'll let @severinbeauvais and @thorwolpert chime in since I am not an expert about Registries' pub/sub architecture and existing setup.
From a requirement perspective, we need to pick up a notification when an account loses access to an organization. The payload needs to contain enough information to determine which account and organization the notification relates to - extra information may be useful, but that is the bare minimum.
If I understand things right this will be a new topic/subscription, it does not necessarily need to be specific to DBC though since this type of event may come in handy for other account-related triggers (possibly?).
thorwolpert commentedon Apr 11, 2025
@esune we have specific subscriptions per service if we want to know if the service is actioning the message, if not they go to a DLQ for some intervention. We do have open topics/subscriptions along the lines of, if you don't process it, it's not a worry.
We use CloudEvents as the envelope and put just enough data into the message that we can discern if we're interested in doing more with the event.
You'll have a better idea of what you need, but in order for Travis to bang this out we'll need to know what elements to add.
eg.
If you wanted to know more, because the elements contained warranted action, you can hit the API for further details.
esune commentedon Apr 15, 2025
Circling back, I am not sure whether more information is needed to move forward, or we are just waiting for this to be scheduled/tackled - please let me know if you need me, a quick chat might be best as I am still familiarizing with the overall architecture/system.
severinbeauvais commentedon Apr 15, 2025
Emiliano, can you answer this?
esune commentedon Apr 15, 2025
I got an invite from @JohnamLane for thursday, I think we will sort this out then - I will likely have questions on what is available to be exposed as well.
JohnamLane commentedon Apr 17, 2025
Hey team! Please add your planning poker estimate with Zenhub @Jxio @ochiu @phungchithanh
esune commentedon Apr 23, 2025
@JohnamLane following-up on this to see if your team can provide us with some documentation/examples for the pub/sub APis and possibly mock data so we can start working on our end while we wait for the change to be developed/deployed for final end-to-end validation.
ochiu commentedon Apr 25, 2025
@esune
Some general pub/sub guide information
https://cloud.google.com/pubsub/docs/publish-receive-messages-client-library
We are using this sbc common lib for connecting to the gcp queue
https://github.com/bcgov/sbc-connect-common/tree/main/python/gcp-queue
This is our queue publisher helper in pay-api
https://github.com/bcgov/sbc-pay/blob/main/pay-api/src/pay_api/services/gcp_queue_publisher.py
Here is some reference code on how messages are received and data retrieved from the message
https://github.com/bcgov/sbc-auth/blob/main/queue_services/auth-queue/src/auth_queue/resources/worker.py
ochiu commentedon May 12, 2025
Some example messages:
{"data": {"accountId": 3727, "actionedBy": 5751, "actionCategory": "account-management", "businessIdentifier": "BC0887890", "userIds": [5853]}, "datacontenttype": "application/json", "id": "204372f6-6265-4236-bbc4-94e564b4804b", "source": "auth-api", "specversion": "1.0", "subject": null, "time": "2025-05-12T15:07:31.855954+00:00", "type": "bc.registry.auth.businessUnaffiliated"}
{"data": {"accountId": 3727, "actionedBy": 5751, "actionCategory": "account-management", "businessIdentifier": "BC0887890", "userIds": [5853]}, "datacontenttype": "application/json", "id": "36e8d3d1-3ce6-4221-b180-4af97adf72ac", "source": "auth-api", "specversion": "1.0", "subject": null, "time": "2025-05-12T15:07:44.203476+00:00", "type": "bc.registry.auth.businessAffiliated"}
{"data": {"accountId": 3141, "actionedBy": 5853, "actionCategory": "account-management", "businessIdentifier": null, "userIds": [5853]}, "datacontenttype": "application/json", "id": "97fe5203-5f8a-4f5d-b109-7759e82b1f3e", "source": "auth-api", "specversion": "1.0", "subject": null, "time": "2025-05-12T15:10:42.659630+00:00", "type": "bc.registry.auth.teamMemberRemoved"}
I just set up a test subscriber to make sure the messages were received, once we know the endpoint URL for the DBC listener we can set it up so it starts getting messages pushed to it.
JohnamLane commentedon May 13, 2025
@esune and @lorriewright (in Olga's absence) This is in QA now. I will signal when it's ready to use in Test for the DBC project.
seeker25 commentedon May 13, 2025
This is feature flagged (DEV/TEST only for now, no prod)
severinbeauvais commentedon May 13, 2025