diff --git a/CHANGELOG.md b/CHANGELOG.md index 98725d9b1c75..16f75c02aee3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ **Table of Contents** -- [ (2023-10-27)](#2023-10-27) +- [ (2023-10-30)](#2023-10-30) - [Breaking Changes](#breaking-changes) - [Bug Fixes](#bug-fixes) - [Documentation](#documentation) @@ -313,7 +313,7 @@ -# [](https://github.com/ory/kratos/compare/v1.0.0...v) (2023-10-27) +# [](https://github.com/ory/kratos/compare/v1.0.0...v) (2023-10-30) ## Breaking Changes @@ -525,6 +525,28 @@ https://github.com/ory/kratos/pull/3480 - style: format +- Registration should accept hydra login + ([#3592](https://github.com/ory/kratos/issues/3592)) + ([7a47827](https://github.com/ory/kratos/commit/7a47827cfd58ef68ebfbbeaf5ed86c394ba2bd5e)): + + - fix: registration should accept hydra login + + - fix: oauth2 registration flow with session + + - wip: registration oauth flow tests + + - wip: refactor oauth flows test + + - wip: refactor op_registration_test + + - wip: oauth provider registration test + + - wip: refactor oauth flows test + + - fix(test): oauth provider login + + - style: format + - Registration with verification ([#3451](https://github.com/ory/kratos/issues/3451)) ([77c3196](https://github.com/ory/kratos/commit/77c3196fd60c5927b84e9a7f6546f80ac2d78ee5)) @@ -540,6 +562,9 @@ https://github.com/ory/kratos/pull/3480 - Remove slow queries from update identities ([#3553](https://github.com/ory/kratos/issues/3553)) ([d138abb](https://github.com/ory/kratos/commit/d138abb6278ebb232e120bee0fb956a0f2816b8d)) +- Respect gomail.SendError in mail queue + ([#3600](https://github.com/ory/kratos/issues/3600)) + ([9c608b9](https://github.com/ory/kratos/commit/9c608b991874d839782d9219f2fc27d0d4a398af)) - Respond with 422 when SPA identity requires AAL2 ([#3572](https://github.com/ory/kratos/issues/3572)) ([df18c09](https://github.com/ory/kratos/commit/df18c09e0089743e8aee17540d277b9572252e06)): @@ -793,6 +818,13 @@ https://github.com/ory/kratos/pull/3480 - One-time code native flows ([#3516](https://github.com/ory/kratos/issues/3516)) ([9b0fee3](https://github.com/ory/kratos/commit/9b0fee30f980d860fd548e7589fa6a06e593537a)) +- Parametrize courier worker + ([#3601](https://github.com/ory/kratos/issues/3601)) + ([0e4be57](https://github.com/ory/kratos/commit/0e4be57e41e1152f4be22f490541c2c099cfe3fe)): + + Allows one to parametrize how many messages the courier will fetch and how + often it will fetch messages. + - Passwordless browser login and registration via code to email ([#3378](https://github.com/ory/kratos/issues/3378)) ([eaaf375](https://github.com/ory/kratos/commit/eaaf37519917612671238412a633847386d7c613)), diff --git a/courier/courier.go b/courier/courier.go index 7a7f022b68c9..b42a580fc061 100644 --- a/courier/courier.go +++ b/courier/courier.go @@ -100,6 +100,7 @@ func (c *courier) UseBackoff(b backoff.BackOff) { } func (c *courier) watchMessages(ctx context.Context, errChan chan error) { + wait := c.deps.CourierConfig().CourierWorkerPullWait(ctx) c.backoff.Reset() for { if err := backoff.Retry(func() error { @@ -108,6 +109,6 @@ func (c *courier) watchMessages(ctx context.Context, errChan chan error) { errChan <- err return } - time.Sleep(time.Second) + time.Sleep(wait) } } diff --git a/courier/courier_dispatcher.go b/courier/courier_dispatcher.go index 9969b76ec3f2..8470c024fca4 100644 --- a/courier/courier_dispatcher.go +++ b/courier/courier_dispatcher.go @@ -54,8 +54,9 @@ func (c *courier) DispatchMessage(ctx context.Context, msg Message) error { func (c *courier) DispatchQueue(ctx context.Context) error { maxRetries := c.deps.CourierConfig().CourierMessageRetries(ctx) + pullCount := c.deps.CourierConfig().CourierWorkerPullCount(ctx) - messages, err := c.deps.CourierPersister().NextMessages(ctx, 10) + messages, err := c.deps.CourierPersister().NextMessages(ctx, uint8(pullCount)) if err != nil { if errors.Is(err, ErrQueueEmpty) { return nil diff --git a/driver/config/config.go b/driver/config/config.go index 950152f6d088..edec657e10ae 100644 --- a/driver/config/config.go +++ b/driver/config/config.go @@ -77,6 +77,8 @@ const ( ViperKeyCourierSMSEnabled = "courier.sms.enabled" ViperKeyCourierSMSFrom = "courier.sms.from" ViperKeyCourierMessageRetries = "courier.message_retries" + ViperKeyCourierWorkerPullCount = "courier.worker.pull_count" + ViperKeyCourierWorkerPullWait = "courier.worker.pull_wait" ViperKeySecretsDefault = "secrets.default" ViperKeySecretsCookie = "secrets.cookie" ViperKeySecretsCipher = "secrets.cipher" @@ -289,6 +291,8 @@ type ( CourierTemplatesLoginCodeValid(ctx context.Context) *CourierEmailTemplate CourierTemplatesRegistrationCodeValid(ctx context.Context) *CourierEmailTemplate CourierMessageRetries(ctx context.Context) int + CourierWorkerPullCount(ctx context.Context) int + CourierWorkerPullWait(ctx context.Context) time.Duration } ) @@ -1110,6 +1114,14 @@ func (p *Config) CourierMessageRetries(ctx context.Context) int { return p.GetProvider(ctx).IntF(ViperKeyCourierMessageRetries, 5) } +func (p *Config) CourierWorkerPullCount(ctx context.Context) int { + return p.GetProvider(ctx).Int(ViperKeyCourierWorkerPullCount) +} + +func (p *Config) CourierWorkerPullWait(ctx context.Context) time.Duration { + return p.GetProvider(ctx).Duration(ViperKeyCourierWorkerPullWait) +} + func (p *Config) CourierSMTPHeaders(ctx context.Context) map[string]string { return p.GetProvider(ctx).StringMap(ViperKeyCourierSMTPHeaders) } diff --git a/embedx/config.schema.json b/embedx/config.schema.json index 0443ae5ae4f3..0f1cfd03546d 100644 --- a/embedx/config.schema.json +++ b/embedx/config.schema.json @@ -1781,6 +1781,23 @@ "default": 5, "examples": [10, 60] }, + "worker": { + "description": "Configures the dispatch worker.", + "type": "object", + "properties": { + "pull_count": { + "description": "Defines how many messages are pulled from the queue at once.", + "type": "integer", + "default": 10 + }, + "pull_wait": { + "description": "Defines how long the worker waits before pulling messages from the queue again.", + "type": "string", + "pattern": "^([0-9]+(ns|us|ms|s|m|h))+$", + "default": "1s" + } + } + }, "delivery_strategy": { "title": "Delivery Strategy", "description": "Defines how emails will be sent, either through SMTP (default) or HTTP.", diff --git a/selfservice/strategy/code/code_sender.go b/selfservice/strategy/code/code_sender.go index d3667aea3b07..3317fafdb2e4 100644 --- a/selfservice/strategy/code/code_sender.go +++ b/selfservice/strategy/code/code_sender.go @@ -252,7 +252,7 @@ func (s *Sender) SendVerificationCode(ctx context.Context, f *verification.Flow, s.deps.Audit(). WithField("via", via). WithField("strategy", "code"). - WithSensitiveField("email_address", address). + WithSensitiveField("email_address", to). WithField("was_notified", notifyUnknownRecipients). Info("Address verification was requested for an unknown address.") if !notifyUnknownRecipients { diff --git a/selfservice/strategy/link/sender.go b/selfservice/strategy/link/sender.go index 99b6f22732fc..d58f167335d7 100644 --- a/selfservice/strategy/link/sender.go +++ b/selfservice/strategy/link/sender.go @@ -123,7 +123,7 @@ func (s *Sender) SendVerificationLink(ctx context.Context, f *verification.Flow, s.r.Audit(). WithField("via", via). WithField("strategy", "link"). - WithSensitiveField("email_address", address). + WithSensitiveField("email_address", to). WithField("was_notified", notifyUnknownRecipients). Info("Address verification was requested for an unknown address.") if !notifyUnknownRecipients {