Skip to content

Commit

Permalink
Merge branch 'master' into update-otp
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Dec 17, 2022
2 parents 9785ed3 + 561e568 commit 9315065
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 71 deletions.
89 changes: 51 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

**Table of Contents**

- [ (2022-12-06)](#2022-12-06)
- [ (2022-12-16)](#2022-12-16)
- [Breaking Changes](#breaking-changes)
- [Bug Fixes](#bug-fixes)
- [Features](#features)
- [0.11.0 (2022-12-02)](#0110-2022-12-02)
- [Breaking Changes](#breaking-changes-1)
- [Bug Fixes](#bug-fixes)
- [Bug Fixes](#bug-fixes-1)
- [Code Generation](#code-generation)
- [Code Refactoring](#code-refactoring)
- [Documentation](#documentation)
Expand All @@ -19,11 +20,11 @@
- [Tests](#tests)
- [Unclassified](#unclassified)
- [0.10.1 (2022-06-01)](#0101-2022-06-01)
- [Bug Fixes](#bug-fixes-1)
- [Bug Fixes](#bug-fixes-2)
- [Code Generation](#code-generation-1)
- [0.10.0 (2022-05-30)](#0100-2022-05-30)
- [Breaking Changes](#breaking-changes-2)
- [Bug Fixes](#bug-fixes-2)
- [Bug Fixes](#bug-fixes-3)
- [Code Generation](#code-generation-2)
- [Code Refactoring](#code-refactoring-1)
- [Documentation](#documentation-1)
Expand All @@ -32,15 +33,15 @@
- [Unclassified](#unclassified-1)
- [0.9.0-alpha.3 (2022-03-25)](#090-alpha3-2022-03-25)
- [Breaking Changes](#breaking-changes-3)
- [Bug Fixes](#bug-fixes-3)
- [Bug Fixes](#bug-fixes-4)
- [Code Generation](#code-generation-3)
- [Documentation](#documentation-2)
- [0.9.0-alpha.2 (2022-03-22)](#090-alpha2-2022-03-22)
- [Bug Fixes](#bug-fixes-4)
- [Bug Fixes](#bug-fixes-5)
- [Code Generation](#code-generation-4)
- [0.9.0-alpha.1 (2022-03-21)](#090-alpha1-2022-03-21)
- [Breaking Changes](#breaking-changes-4)
- [Bug Fixes](#bug-fixes-5)
- [Bug Fixes](#bug-fixes-6)
- [Code Generation](#code-generation-5)
- [Code Refactoring](#code-refactoring-2)
- [Documentation](#documentation-3)
Expand All @@ -49,37 +50,37 @@
- [Unclassified](#unclassified-2)
- [0.8.3-alpha.1.pre.0 (2022-01-21)](#083-alpha1pre0-2022-01-21)
- [Breaking Changes](#breaking-changes-5)
- [Bug Fixes](#bug-fixes-6)
- [Bug Fixes](#bug-fixes-7)
- [Code Generation](#code-generation-6)
- [Code Refactoring](#code-refactoring-3)
- [Documentation](#documentation-4)
- [Features](#features-4)
- [Tests](#tests-3)
- [0.8.2-alpha.1 (2021-12-17)](#082-alpha1-2021-12-17)
- [Bug Fixes](#bug-fixes-7)
- [Bug Fixes](#bug-fixes-8)
- [Code Generation](#code-generation-7)
- [Documentation](#documentation-5)
- [0.8.1-alpha.1 (2021-12-13)](#081-alpha1-2021-12-13)
- [Bug Fixes](#bug-fixes-8)
- [Bug Fixes](#bug-fixes-9)
- [Code Generation](#code-generation-8)
- [Documentation](#documentation-6)
- [Features](#features-5)
- [Tests](#tests-4)
- [0.8.0-alpha.4.pre.0 (2021-11-09)](#080-alpha4pre0-2021-11-09)
- [Breaking Changes](#breaking-changes-6)
- [Bug Fixes](#bug-fixes-9)
- [Bug Fixes](#bug-fixes-10)
- [Code Generation](#code-generation-9)
- [Documentation](#documentation-7)
- [Features](#features-6)
- [Tests](#tests-5)
- [0.8.0-alpha.3 (2021-10-28)](#080-alpha3-2021-10-28)
- [Bug Fixes](#bug-fixes-10)
- [Bug Fixes](#bug-fixes-11)
- [Code Generation](#code-generation-10)
- [0.8.0-alpha.2 (2021-10-28)](#080-alpha2-2021-10-28)
- [Code Generation](#code-generation-11)
- [0.8.0-alpha.1 (2021-10-27)](#080-alpha1-2021-10-27)
- [Breaking Changes](#breaking-changes-7)
- [Bug Fixes](#bug-fixes-11)
- [Bug Fixes](#bug-fixes-12)
- [Code Generation](#code-generation-12)
- [Code Refactoring](#code-refactoring-4)
- [Documentation](#documentation-8)
Expand All @@ -92,24 +93,24 @@
- [0.7.5-alpha.1 (2021-09-11)](#075-alpha1-2021-09-11)
- [Code Generation](#code-generation-14)
- [0.7.4-alpha.1 (2021-09-09)](#074-alpha1-2021-09-09)
- [Bug Fixes](#bug-fixes-12)
- [Bug Fixes](#bug-fixes-13)
- [Code Generation](#code-generation-15)
- [Documentation](#documentation-9)
- [Features](#features-8)
- [Tests](#tests-7)
- [0.7.3-alpha.1 (2021-08-28)](#073-alpha1-2021-08-28)
- [Bug Fixes](#bug-fixes-13)
- [Bug Fixes](#bug-fixes-14)
- [Code Generation](#code-generation-16)
- [Documentation](#documentation-10)
- [Features](#features-9)
- [0.7.1-alpha.1 (2021-07-22)](#071-alpha1-2021-07-22)
- [Bug Fixes](#bug-fixes-14)
- [Bug Fixes](#bug-fixes-15)
- [Code Generation](#code-generation-17)
- [Documentation](#documentation-11)
- [Tests](#tests-8)
- [0.7.0-alpha.1 (2021-07-13)](#070-alpha1-2021-07-13)
- [Breaking Changes](#breaking-changes-8)
- [Bug Fixes](#bug-fixes-15)
- [Bug Fixes](#bug-fixes-16)
- [Code Generation](#code-generation-18)
- [Code Refactoring](#code-refactoring-5)
- [Documentation](#documentation-12)
Expand All @@ -118,7 +119,7 @@
- [Unclassified](#unclassified-4)
- [0.6.3-alpha.1 (2021-05-17)](#063-alpha1-2021-05-17)
- [Breaking Changes](#breaking-changes-9)
- [Bug Fixes](#bug-fixes-16)
- [Bug Fixes](#bug-fixes-17)
- [Code Generation](#code-generation-19)
- [Code Refactoring](#code-refactoring-6)
- [0.6.2-alpha.1 (2021-05-14)](#062-alpha1-2021-05-14)
Expand All @@ -128,85 +129,85 @@
- [Code Generation](#code-generation-21)
- [Features](#features-11)
- [0.6.0-alpha.2 (2021-05-07)](#060-alpha2-2021-05-07)
- [Bug Fixes](#bug-fixes-17)
- [Bug Fixes](#bug-fixes-18)
- [Code Generation](#code-generation-22)
- [Features](#features-12)
- [0.6.0-alpha.1 (2021-05-05)](#060-alpha1-2021-05-05)
- [Breaking Changes](#breaking-changes-10)
- [Bug Fixes](#bug-fixes-18)
- [Bug Fixes](#bug-fixes-19)
- [Code Generation](#code-generation-23)
- [Code Refactoring](#code-refactoring-7)
- [Documentation](#documentation-14)
- [Features](#features-13)
- [Tests](#tests-10)
- [Unclassified](#unclassified-5)
- [0.5.5-alpha.1 (2020-12-09)](#055-alpha1-2020-12-09)
- [Bug Fixes](#bug-fixes-19)
- [Bug Fixes](#bug-fixes-20)
- [Code Generation](#code-generation-24)
- [Documentation](#documentation-15)
- [Features](#features-14)
- [Tests](#tests-11)
- [Unclassified](#unclassified-6)
- [0.5.4-alpha.1 (2020-11-11)](#054-alpha1-2020-11-11)
- [Bug Fixes](#bug-fixes-20)
- [Bug Fixes](#bug-fixes-21)
- [Code Generation](#code-generation-25)
- [Code Refactoring](#code-refactoring-8)
- [Documentation](#documentation-16)
- [Features](#features-15)
- [0.5.3-alpha.1 (2020-10-27)](#053-alpha1-2020-10-27)
- [Bug Fixes](#bug-fixes-21)
- [Bug Fixes](#bug-fixes-22)
- [Code Generation](#code-generation-26)
- [Documentation](#documentation-17)
- [Features](#features-16)
- [Tests](#tests-12)
- [0.5.2-alpha.1 (2020-10-22)](#052-alpha1-2020-10-22)
- [Bug Fixes](#bug-fixes-22)
- [Bug Fixes](#bug-fixes-23)
- [Code Generation](#code-generation-27)
- [Documentation](#documentation-18)
- [Tests](#tests-13)
- [0.5.1-alpha.1 (2020-10-20)](#051-alpha1-2020-10-20)
- [Bug Fixes](#bug-fixes-23)
- [Bug Fixes](#bug-fixes-24)
- [Code Generation](#code-generation-28)
- [Documentation](#documentation-19)
- [Features](#features-17)
- [Tests](#tests-14)
- [Unclassified](#unclassified-7)
- [0.5.0-alpha.1 (2020-10-15)](#050-alpha1-2020-10-15)
- [Breaking Changes](#breaking-changes-11)
- [Bug Fixes](#bug-fixes-24)
- [Bug Fixes](#bug-fixes-25)
- [Code Generation](#code-generation-29)
- [Code Refactoring](#code-refactoring-9)
- [Documentation](#documentation-20)
- [Features](#features-18)
- [Tests](#tests-15)
- [Unclassified](#unclassified-8)
- [0.4.6-alpha.1 (2020-07-13)](#046-alpha1-2020-07-13)
- [Bug Fixes](#bug-fixes-25)
- [Bug Fixes](#bug-fixes-26)
- [Code Generation](#code-generation-30)
- [0.4.5-alpha.1 (2020-07-13)](#045-alpha1-2020-07-13)
- [Bug Fixes](#bug-fixes-26)
- [Bug Fixes](#bug-fixes-27)
- [Code Generation](#code-generation-31)
- [0.4.4-alpha.1 (2020-07-10)](#044-alpha1-2020-07-10)
- [Bug Fixes](#bug-fixes-27)
- [Bug Fixes](#bug-fixes-28)
- [Code Generation](#code-generation-32)
- [Documentation](#documentation-21)
- [0.4.3-alpha.1 (2020-07-08)](#043-alpha1-2020-07-08)
- [Bug Fixes](#bug-fixes-28)
- [Bug Fixes](#bug-fixes-29)
- [Code Generation](#code-generation-33)
- [0.4.2-alpha.1 (2020-07-08)](#042-alpha1-2020-07-08)
- [Bug Fixes](#bug-fixes-29)
- [Bug Fixes](#bug-fixes-30)
- [Code Generation](#code-generation-34)
- [0.4.0-alpha.1 (2020-07-08)](#040-alpha1-2020-07-08)
- [Breaking Changes](#breaking-changes-12)
- [Bug Fixes](#bug-fixes-30)
- [Bug Fixes](#bug-fixes-31)
- [Code Generation](#code-generation-35)
- [Code Refactoring](#code-refactoring-10)
- [Documentation](#documentation-22)
- [Features](#features-19)
- [Unclassified](#unclassified-9)
- [0.3.0-alpha.1 (2020-05-15)](#030-alpha1-2020-05-15)
- [Breaking Changes](#breaking-changes-13)
- [Bug Fixes](#bug-fixes-31)
- [Bug Fixes](#bug-fixes-32)
- [Chores](#chores)
- [Code Refactoring](#code-refactoring-11)
- [Documentation](#documentation-23)
Expand All @@ -217,18 +218,18 @@
- [Documentation](#documentation-24)
- [0.2.0-alpha.2 (2020-05-04)](#020-alpha2-2020-05-04)
- [Breaking Changes](#breaking-changes-14)
- [Bug Fixes](#bug-fixes-32)
- [Bug Fixes](#bug-fixes-33)
- [Chores](#chores-2)
- [Code Refactoring](#code-refactoring-12)
- [Documentation](#documentation-25)
- [Features](#features-21)
- [Unclassified](#unclassified-11)
- [0.1.1-alpha.1 (2020-02-18)](#011-alpha1-2020-02-18)
- [Bug Fixes](#bug-fixes-33)
- [Bug Fixes](#bug-fixes-34)
- [Code Refactoring](#code-refactoring-13)
- [Documentation](#documentation-26)
- [0.1.0-alpha.6 (2020-02-16)](#010-alpha6-2020-02-16)
- [Bug Fixes](#bug-fixes-34)
- [Bug Fixes](#bug-fixes-35)
- [Code Refactoring](#code-refactoring-14)
- [Documentation](#documentation-27)
- [Features](#features-22)
Expand All @@ -241,7 +242,7 @@
- [0.1.0-alpha.3 (2020-02-06)](#010-alpha3-2020-02-06)
- [Continuous Integration](#continuous-integration-1)
- [0.1.0-alpha.2 (2020-02-03)](#010-alpha2-2020-02-03)
- [Bug Fixes](#bug-fixes-35)
- [Bug Fixes](#bug-fixes-36)
- [Documentation](#documentation-30)
- [Features](#features-24)
- [Unclassified](#unclassified-12)
Expand Down Expand Up @@ -284,14 +285,26 @@

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# [](https://github.com/ory/kratos/compare/v0.11.0...v) (2022-12-06)
# [](https://github.com/ory/kratos/compare/v0.11.0...v) (2022-12-16)

## Breaking Changes

The `/admin/courier/messages` endpoint now uses `keysetpagination` instead.

### Bug Fixes

- Cors headers not added to the response
[#2922](https://github.com/ory/kratos/issues/2922)
([#2934](https://github.com/ory/kratos/issues/2934))
([1ed6839](https://github.com/ory/kratos/commit/1ed6839369baeecc99610d9f04d78dfee53ad72a))
- Flaky test now stable
([4e5dcd0](https://github.com/ory/kratos/commit/4e5dcd0df6baffda8b15eda37fd7a247793f3297))

### Features

- Add NID to logs in courier
([#2956](https://github.com/ory/kratos/issues/2956))
([b407aa9](https://github.com/ory/kratos/commit/b407aa9427382f38dd8a992a6998202a7b6ba83a))
- Require verification on login
([#2927](https://github.com/ory/kratos/issues/2927))
([efb8ae8](https://github.com/ory/kratos/commit/efb8ae89cbc31477c2696a0df4c89d6dbf856d27))
Expand Down
8 changes: 8 additions & 0 deletions courier/courier_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func (c *courier) DispatchMessage(ctx context.Context, msg Message) error {
c.deps.Logger().
WithError(err).
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Error(`Unable to increment the message's "send_count" field`)
return err
}
Expand All @@ -35,12 +36,14 @@ func (c *courier) DispatchMessage(ctx context.Context, msg Message) error {
c.deps.Logger().
WithError(err).
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Error(`Unable to set the message status to "sent".`)
return err
}

c.deps.Logger().
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
WithField("message_type", msg.Type).
WithField("message_template_type", msg.TemplateType).
WithField("message_subject", msg.Subject).
Expand All @@ -66,12 +69,14 @@ func (c *courier) DispatchQueue(ctx context.Context) error {
c.deps.Logger().
WithError(err).
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Error(`Unable to set the retried message's status to "abandoned".`)
return err
}
// Skip the message
c.deps.Logger().
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Warnf(`Message was abandoned because it did not deliver after %d attempts`, msg.SendCount)

} else if err := c.DispatchMessage(ctx, msg); err != nil {
Expand All @@ -80,6 +85,7 @@ func (c *courier) DispatchQueue(ctx context.Context) error {
c.deps.Logger().
WithError(err).
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Error(`Unable to record failure log entry.`)
}

Expand All @@ -91,6 +97,7 @@ func (c *courier) DispatchQueue(ctx context.Context) error {
c.deps.Logger().
WithError(err).
WithField("message_id", replace.ID).
WithField("message_nid", replace.NID).
Error(`Unable to reset the failed message's status to "queued".`)
}
}
Expand All @@ -100,6 +107,7 @@ func (c *courier) DispatchQueue(ctx context.Context) error {
c.deps.Logger().
WithError(err).
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Error(`Unable to record success log entry.`)
// continue with execution, as the message was successfully dispatched
}
Expand Down
6 changes: 6 additions & 0 deletions courier/smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,15 @@ func (c *courier) dispatchEmail(ctx context.Context, msg Message) error {
c.deps.Logger().
WithError(err).
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Error(`Unable to get email template from message.`)
} else {
htmlBody, err := tmpl.EmailBody(ctx)
if err != nil {
c.deps.Logger().
WithError(err).
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Error(`Unable to get email body from template.`)
} else {
gm.AddAlternative("text/html", htmlBody)
Expand All @@ -205,6 +207,8 @@ func (c *courier) dispatchEmail(ctx context.Context, msg Message) error {
WithField("smtp_server", fmt.Sprintf("%s:%d", c.smtpClient.Host, c.smtpClient.Port)).
WithField("smtp_ssl_enabled", c.smtpClient.SSL).
WithField("message_from", from).
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Error("Unable to send email using SMTP connection.")

var protoErr *textproto.Error
Expand All @@ -215,6 +219,7 @@ func (c *courier) dispatchEmail(ctx context.Context, msg Message) error {
c.deps.Logger().
WithError(err).
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
Error(`Unable to reset the retried message's status to "abandoned".`)
return err
}
Expand All @@ -225,6 +230,7 @@ func (c *courier) dispatchEmail(ctx context.Context, msg Message) error {

c.deps.Logger().
WithField("message_id", msg.ID).
WithField("message_nid", msg.NID).
WithField("message_type", msg.Type).
WithField("message_template_type", msg.TemplateType).
WithField("message_subject", msg.Subject).
Expand Down

0 comments on commit 9315065

Please sign in to comment.