-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add ADR 0003: Inter-service communication #4
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
Open
illicitonion
wants to merge
2
commits into
main
Choose a base branch
from
adr/0003-inter-service-communication
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| --- | ||
| status: "accepted" | ||
| date: 2025-09-29 | ||
| deciders: Jon Sharpe, Daniel Wagner-Hall, Karen Klein | ||
| consulted: Adedayo Adesegun, Ali Nosratipour, Anna Hrychaniuk, Berkeli H, Borja Lorente, Cagla Akin, Craig D'Silva, Beki Meigag, Elhadj Abdoul Diallo, Dayeon Lee, Golden Mac-Eteli, Matt Stevenson, Peter Mudra | ||
| informed: \#cyf-tech-products | ||
| --- | ||
| # Inter-service communication: Prefer delegated authority where possible | ||
|
|
||
| ## Context and Problem Statement | ||
|
|
||
| Increasingly, CYF has multiple services which want to share data between each other. The first systems which had this need opted to duplicate that information for convenience, but this is not a scalable or maintainable solution. Currently most that data is primarily owned by the Dashboard ("CYF Core API"), and is duplicated into Classplanner, but increasingly other systems (such as the Trainee Tracker) want to access similar data. | ||
|
|
||
| ## Considered Options | ||
|
|
||
| * Accessing or sharing databases directly | ||
| * API access via powerful service tokens, with each client service gaining broad access to server service data, and making individual authorisation decisions | ||
| * API access via delegated authority, with each client service passing credentials on behalf of a request's originating user | ||
|
|
||
| ## Decision Outcome | ||
|
|
||
| Chosen option: API access via delegated authority, because it: | ||
| * Minimises duplication across services | ||
| * Reduces the likelihood of accidentally leaking or destroying sensitive information | ||
| * Allows for internal re-implementation of individual services without coordination, as long as the published API doesn't change | ||
|
|
||
| ### Confirmation | ||
|
|
||
| When new APIs are exposed by services, they include a declaration of expected stability. Automated tests should be added for (at least the schema of) any claimed stability which will notify teams when they are breaking external promises. | ||
|
|
||
| Confirmation of delegated authority specifically is left as a per-review exercise to the relevant teams. | ||
|
|
||
| ## More Information | ||
|
|
||
| See [this initial proposal document for briefing context](https://docs.google.com/document/d/1zBzs2-LFOJFK-3b4fXqQ28Q1pf5hZv1vHFC9YcEfJ8I/edit). This ADR was discussed and agreed at the tech-products in-person meet-up on 2025-09-20. | ||
|
|
||
| ## Action items | ||
|
|
||
| ### Investigate and deploy an identity provider | ||
|
|
||
| [Borja suggests that Supabase (currently being deployed by Devops) could be a reasonable identity provider](https://docs.google.com/document/d/1NyoezZz7P3wAROoAl51abvRUWjIa3Iw2yu6EbhQEWLU/edit). The Devops team are deploying Supabase and we will experiment with this when it's deployed. | ||
|
|
||
| ### Collect roles | ||
|
|
||
| The identity provider will need to support different roles such as "Trainee", "Volunteer", "Volunteer in Glasgow", etc. We should collect the kind of role queries we may want to ask an identity provider. | ||
|
|
||
| We may want to use GitHub teams or similar for this. | ||
|
|
||
| This needn't be an up-front exercise, we can do this on-demand as we develop more APIs. | ||
|
|
||
| ### Prototype locations without authorisation | ||
|
|
||
| The Classplanner team will prototype a "Locations" API from the CYF API, try changing Classplanner to use it rather than duplicating its own list of Locations, and see what troubles they run into. | ||
|
|
||
| ## Advertise and maintain stable APIs | ||
|
|
||
| It was agreed that API modifications will be discussed on Slack, initially in #cyf-tech-products. | ||
|
|
||
| ## Terminology | ||
|
|
||
| We have agreed a [common glossary of terminology](https://docs.google.com/document/d/1e7o7LSKTwtBFGwFESXjW_QsmqhsSK5buoshlpL0AVoA/edit) for using across APIs. These must be used in APIs where applicable, but are optional for use in UIs. | ||
|
|
||
| There is no urgent need to adopt this terminology in existing code, but it should be preferred in new code, and particularly in new APIs. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.