-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7900af7
commit 0244c50
Showing
48 changed files
with
1,132 additions
and
321 deletions.
There are no files selected for viewing
This file contains 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
26 changes: 26 additions & 0 deletions
26
docs/design-principles/0090-authentication-authorization.md
This file contains 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,26 @@ | ||
# Authentication & Authorization | ||
|
||
## Design Principles | ||
|
||
## Implementation | ||
|
||
### Password Credential Authentication | ||
|
||
### Token Authorization | ||
|
||
### HMAC Authentication/Authorization | ||
|
||
### APIKey Authorization | ||
|
||
### Cookie Authentication | ||
|
||
### Cookie Authorization | ||
|
||
* Usually performed by a BackendForFrontend component, reverse-proxies the token hidden in the cookie, into a token passed to the backend | ||
|
||
### Declarative Authorization Syntax | ||
|
||
### Role Based Authorization | ||
|
||
### Feature Based Authorization | ||
|
15 changes: 0 additions & 15 deletions
15
docs/design-principles/0090-authentication-authorization.md.md
This file was deleted.
Oops, something went wrong.
This file contains 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,18 @@ | ||
# Email Delivery | ||
|
||
## Design Principles | ||
|
||
Many processes in the backend of a SaaS product aim to alert the user to activities or processes in a SaaS product, that warrant their attention, and most of these notifications/alerts are ultimately delivered by email (albeit some are delivered by other means too, i.e. in-app, SMS texts etc). | ||
|
||
Sending emails is often done via 3rd party systems like: SendGrid, MailGun, PostMark etc., over HTTP. Due to its nature, this mechanism isn't very reliable, especially with systems under load. | ||
|
||
* We need to "broker" between the sending of emails and the delivering of them to make the entire process more reliable, and we need to provide observability when things go wrong. | ||
* Since an inbound API request to any API backend can yield of the order ~10 emails per API call, delivering them reliably across HTTP can require minutes of time. If you consider the possibility of retries and back-offs etc. We simply could not afford to keep API clients blocked and waiting while email delivery takes place, let alone the risk of timing out their connection to the inbound API call in the first place. | ||
|
||
Fortunately, an individual email arriving in a person inbox is not a time-critical and synchronous usability function to begin with. Some delay is anticipated. | ||
|
||
Thus we need to take advantage of all these facts and engineer a reliable mechanism. | ||
|
||
## Implementation | ||
|
||
 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains 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
This file contains 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,24 @@ | ||
using Amazon.Lambda.Annotations; | ||
using Amazon.Lambda.Core; | ||
using Amazon.Lambda.SQSEvents; | ||
using Application.Persistence.Shared.ReadModels; | ||
using AWSLambdas.Api.WorkerHost.Extensions; | ||
using Infrastructure.Workers.Api; | ||
|
||
namespace AWSLambdas.Api.WorkerHost.Lambdas; | ||
|
||
public class DeliverEmail | ||
{ | ||
private readonly IQueueMonitoringApiRelayWorker<EmailMessage> _worker; | ||
|
||
public DeliverEmail(IQueueMonitoringApiRelayWorker<EmailMessage> worker) | ||
{ | ||
_worker = worker; | ||
} | ||
|
||
[LambdaFunction] | ||
public async Task<bool> Run(SQSEvent sqsEvent, ILambdaContext context) | ||
{ | ||
return await sqsEvent.RelayRecordsAsync(_worker, CancellationToken.None); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.