Skip to content

Conversation

kevinbader
Copy link
Contributor

@kevinbader kevinbader commented Sep 8, 2019

Description

Added:

  • When terminating an SSE connection after its associated session has
    been blacklisted, RIG now sends out a rig.session_killed event before
    closing the socket.
  • New API for querying and updating the session blacklist: /v2/session-blacklist, which introduces the following breaking changes:
    • When a session has been added to the session blacklist successfully, the endpoint now uses the correct HTTP status code "201 Created" instead of "200 Ok".
    • When using the API to blacklist a session, the validityInSeconds should now be passed as an integer value (using a string still works though).

Removed:

Security:

  • A connection is now associated to its session right after the
    connection is established, given the request carries a JWT in its
    authorization header. Previously, this was only done by the
    subscriptions endpoint, which could cause a connection to remain active
    even after blacklisting its authorization token.

On a side note, I've also improved the logging a bit: in debug level, there haven't been any logs in case the on_error callback was invoked in the ConnectionInit module; now RIG will tell us in case something went wrong, and even output all the outgoing messages, at least for SSE.

What to look out for

Dear reviewer, I want you to

  • check that the code works on your machine.
  • suggest implementation-code design/structure/readability improvements.
  • suggest test-code design/structure/readability improvements.

I know that we still don't have anything on the blacklist feature on the website, but let's resolve this in a follow-up PR.

Added:

- When terminating an SSE connection after its associated session has
been blacklisted, RIG now sends out a `rig.session_killed` event before
closing the socket.

Changed:

- When a session has been added to the session blacklist successfully,
the endpoint now uses the correct HTTP status code "201 Created" instead
of "200 Ok".
- When using the API to blacklist a session, the `validityInSeconds`
should now be passed as an integer value (see `Deprecated` below).

Deprecated:

- When using the API to blacklist a session, passing the
`validityInSeconds` field as a string is deprecated (but supported until
the 3.0 release). Please use an integer instead.

Removed:

- Removed the `JWT_BLACKLIST_DEFAULT_EXPIRY_HOURS` environment variable
([deprecated since 2.0.0-beta.2]).

Security:

- A connection is now associated to its session right after the
connection is established, given the request carries a JWT in its
authorization header. Previously, this was only done by the
subscriptions endpoint, which could cause a connection to remain active
even after blacklisting its authorization token.

[deprecated since 2.0.0-beta.2]: f974533
@kevinbader kevinbader added this to the 2.3.0 milestone Sep 8, 2019
@kevinbader kevinbader changed the title Add blacklist i9n test and fix some stuff along the way WIP: Add blacklist i9n test and fix some stuff along the way Sep 9, 2019
@kevinbader kevinbader changed the title WIP: Add blacklist i9n test and fix some stuff along the way Add blacklist i9n test and fix some stuff along the way Sep 10, 2019
Copy link
Collaborator

@mmacai mmacai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 comments, otherwise tested and works ok.

@kevinbader kevinbader merged commit e4bc9f6 into master Sep 18, 2019
@kevinbader kevinbader deleted the blacklist-i9n-test branch September 18, 2019 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants