Skip to content
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

Supabase master #2

Merged
merged 157 commits into from
Dec 5, 2023
Merged

Supabase master #2

merged 157 commits into from
Dec 5, 2023

Commits on Apr 18, 2023

  1. fix: fix flow state expiry check (supabase#1088)

    ## What kind of change does this PR introduce?
    
    Currently, the flow states don't expire as expected as the check is
    faulty
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Apr 18, 2023
    Configuration menu
    Copy the full SHA
    6000e70 View commit details
    Browse the repository at this point in the history
  2. fix: make flow_state migrations idempotent, add index (supabase#1086)

    ## What kind of change does this PR introduce?
    
    With the introduction of an Authentication Method check on
    `FindFlowStateByUserID` we may wish to add an index. Also introduces an
    idempotency condition on flow state related migrations. Finally, updates
    the old Postgres comment by [issuing a new comment to overrwrite
    previous
    comment](https://www.postgresql.org/docs/current/sql-comment.html)
    
    
    Left as draft till this is tested together with other remaining PKCE
    changes.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Apr 18, 2023
    Configuration menu
    Copy the full SHA
    7ca755a View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2023

  1. fix: check freq on email change (supabase#1090)

    ## What kind of change does this PR introduce?
    * Email change requests on `PUT /user` should adhere to the max
    frequency rule.
    kangmingtay authored Apr 19, 2023
    Configuration menu
    Copy the full SHA
    659ca66 View commit details
    Browse the repository at this point in the history
  2. refactor: replace unprocessableEntityError with invalidPasswordLength…

    …Error (supabase#1080)
    
    Missed this, follows from supabase#1078 which allows us to substitute the
    following two errors
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Apr 19, 2023
    Configuration menu
    Copy the full SHA
    b4f93fc View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2023

  1. refactor: lump code redirect url generation into function (supabase#1081

    )
    
    ## What kind of change does this PR introduce?
    
    Refactor around the redirect url generation for pkce. Done for
    consistency with how the other redirect urls are generated, and also to
    cut back on a few lines of code.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Apr 20, 2023
    Configuration menu
    Copy the full SHA
    e634d28 View commit details
    Browse the repository at this point in the history
  2. fix: IsDuplicatedEmail should filter out identities for the currentUs…

    …er (supabase#1092)
    
    ## What kind of change does this PR introduce?
    * Fixes supabase#1060, supabase#988 
    * Allows one to pass in an optional `currentUser` into
    `IsDuplicatedUser` to exclude the user's identities when checking for
    duplicates
    * This is optional because on signup / admin create user, there won't be
    a current user so it's guaranteed that any identities found belongs to a
    different user.
    
    ## Current behaviour
    * Currently, `IsDuplicatedEmail` only accepts an `email` and an `aud`
    and uses those fields to check if the `auth.identities` table has
    identities with the same email. When this is used in the context of
    updating a user's email (`PUT /user`), `IsDuplicatedEmail` will also
    include identities that belong to the current user.
    
    ---------
    
    Co-authored-by: Joel Lee <lee.yi.jie.joel@gmail.com>
    kangmingtay and J0 authored Apr 20, 2023
    Configuration menu
    Copy the full SHA
    dd2b688 View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2023

  1. refactor: simplify MFA checks (supabase#1087)

    ## What kind of change does this PR introduce?
    
    The current MFA checks are quite unreadable. Have refactored parts of it
    and I think there's more to refactor.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Apr 21, 2023
    Configuration menu
    Copy the full SHA
    d3d32d1 View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2023

  1. feat: add pkce to email_change routes (supabase#1082)

    ## What kind of change does this PR introduce?
    
    Add PKCE to email Change routes
    
    ## What is the current behavior?
    
    No PKCE on email change routes
    
    ## What is the new behavior?
    
    PKCE on email change routes 
    
    
    ## Additional context
    
    There's an additional AMR claim known as `email_change` I'm not sure
    whether we want to have a special claim for this given that
    `email_change` is not typically classed as a login method. The other
    option would be to use the Magic Link AMR claim instead. Let me know if
    anyone has a preference here.
    
    Should be tested with:
    https://github.com/supabase/gotrue-js/pull/661/files
    
    
    TODOs:
    - [x] Tests need to be written for the PKCE path
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Apr 25, 2023
    Configuration menu
    Copy the full SHA
    0f8548f View commit details
    Browse the repository at this point in the history

Commits on May 2, 2023

  1. refactor: remove unused errors (supabase#1093)

    as per title
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored May 2, 2023
    Configuration menu
    Copy the full SHA
    8ff1661 View commit details
    Browse the repository at this point in the history
  2. feat: add turnstile support (supabase#1094)

    ## Overview
    
    Captcha providers are treated as generic in this PR. Users can swap out
    the provider which in turn swaps out only the `siteverify` URL. This
    approach generally works fine when considering `turnstile` and
    `hcaptcha` since both have similar feature sets.
    
    However, for other providers like `recaptcha` users might want to use
    specialized features such as Android recaptcha and recaptcha V3 score.
    Since the [responses slightly differ between an android response and a
    generic response](https://developers.google.com/recaptcha/docs/verify),
    we may need to introduce separate structs.
    
    Another alternative considered was to initialize a new provider type for
    each methods (similar to `SMSProvider`) and have corresponding
    `verifyCaptcha` methods for each provider. This way there is clear
    separation of decoding logic for response types for each provider but
    there will be slightly more code to maintain.
    
    
    
    
    ### TODOs:
    - [x] Manual testing with FE components
    
    After PR:
    - Update dashboard to reflect additional provider
    - Update [hcaptcha
    docs](https://supabase.com/docs/guides/auth/auth-captcha)
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored May 2, 2023
    Configuration menu
    Copy the full SHA
    b1d2f1c View commit details
    Browse the repository at this point in the history

Commits on May 4, 2023

  1. fix: correct pkce redirect generation (supabase#1097)

    ## What kind of change does this PR introduce?
    
    Currently, it seems like PKCE flow implementation incorrectly adds a `?`
    instead of a `&` to the url when there is a redirect with multiple
    parameters (e.g. on `/resend` like in the url below:) . This PR aims to
    fix this.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored May 4, 2023
    Configuration menu
    Copy the full SHA
    bdf93b4 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2023

  1. feat: allow updating saml providers metadata_xml (supabase#1096)

    ## What kind of change does this PR introduce?
    
    Fix the `PUT` `/admin/providers/<id>` endpoint not committing the
    SAMLProvider changes to the database when updating the metadata XML
    (resulting in a no-op).
    
    ## What is the current behavior?
    
    Updates to the metadata XML via the `/admin/providers/<id>` should be
    reflected on the `saml_provider` database object.
    
    ## What is the new behavior?
    
    The provider metadata XML can now be correctly updated.
    Faless authored May 5, 2023
    Configuration menu
    Copy the full SHA
    20e503e View commit details
    Browse the repository at this point in the history

Commits on May 6, 2023

  1. feat: fix account linking (supabase#1098)

    The issue is that the modified account linking algorithm _always_ linked
    SSO to non-SSO accounts if a similar email account was present.
    hf authored May 6, 2023
    Configuration menu
    Copy the full SHA
    93d12d9 View commit details
    Browse the repository at this point in the history
  2. fix: make migration idempotent (supabase#1079)

    ## What kind of change does this PR introduce?
    * Migration to remove duplicate index wasn't idempotent
    kangmingtay authored May 6, 2023
    Configuration menu
    Copy the full SHA
    2be90c7 View commit details
    Browse the repository at this point in the history
  3. feat: add log entries for pkce (supabase#1068)

    Adds appropriate audit log statements for access tracking and also for
    metrics tracking. For metrics tracking we can also monitor requests to
    the endpoint as a whole
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored May 6, 2023
    Configuration menu
    Copy the full SHA
    9c3ba87 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2023

  1. feat: add saml metadata force update every 24 hours (supabase#1020)

    If the SAML Metadata defined via a URL does not publish validity or
    cache duration information, forcefully try to update it every 24 hours.
    hf authored May 8, 2023
    Configuration menu
    Copy the full SHA
    965feb9 View commit details
    Browse the repository at this point in the history
  2. fix: resend email change & phone change issues (supabase#1100)

    ## What kind of change does this PR introduce?
    * Fix supabase#1095 where `/resend` doesn't work if the user initially signed up
    with a phone number and is trying to resend an email change email
    kangmingtay authored May 8, 2023
    Configuration menu
    Copy the full SHA
    184fa38 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2023

  1. feat: add database cleanup logic, runs after each request (supabase#875)

    Certain database entities such as refresh tokens and sessions pile up
    though normal operation without being cleaned up. This PR attempts to
    solve the problem by using a `models.Cleanup` function which takes care
    of these entities.
    
    The cleanup runs after each request on non-idempotent HTTP methods
    (POST, PUT, DELETE, PATCH). It uses fast deletes and updates using [`FOR
    UPDATE SKIP
    LOCKED`](https://www.postgresql.org/docs/current/sql-select.html#SQL-FOR-UPDATE-SHARE)
    so that deletes don't wait for other transactions to complete.
    
    It runs after each request as this model scales better than a background
    job that runs periodically as it is using resources only when the API is
    being used externally, making database use proportional to work
    performed.
    
    Rows are deleted about 24-72 hours after they have expired to aid in
    debugging if ever necessary.
    hf authored May 9, 2023
    Configuration menu
    Copy the full SHA
    aaad5bd View commit details
    Browse the repository at this point in the history

Commits on May 11, 2023

  1. fix: add guard check in case factor, session, or user are missing (su…

    …pabase#1099)
    
    Aims to prevent the existing issue where the session seems to be lost
    and a null pointer execption is raised.
    
    HS ID: 1575266879
    
    The root cause is still unidentified and we have only been able to
    reproduce once. Hoping that with the guard check we can flag more
    instances. Last recorded occurrence was in April
    
    
    We will follow up with the user to see if there are any repeat
    occurences
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored May 11, 2023
    Configuration menu
    Copy the full SHA
    b4a3fec View commit details
    Browse the repository at this point in the history
  2. feat: Add new Kakao Provider (supabase#834)

    ## What kind of change does this PR introduce?
    
    This PR adds Kakao(https://accounts.kakao.com/) as an external provider.
    
    ## What is the current behavior?
    
    This provider did not exist before.
    
    ## What is the new behavior?
    
    Based on Kakao developer docs(https://developers.kakao.com/), this PR
    creates a provider & test suite for Kakao external provider.
    
    ## Additional context
    
    Please let me know if there are any changes needed, I do acknowledge
    that this was once mentioned in another
    [comment](supabase#451 (comment)),
    but it seemed like the PR had been frozen since then. I wrote my own
    version to make sure the tests do pass and the features work properly.
    
    ---------
    
    Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
    esinx and kangmingtay authored May 11, 2023
    Configuration menu
    Copy the full SHA
    bafb89b View commit details
    Browse the repository at this point in the history

Commits on May 12, 2023

  1. fix: allow gotrue to work with multiple custom domains (supabase#999)

    ## What kind of change does this PR introduce?
    * Improves on supabase#725, albeit with a slightly different approach
    * Gotrue will accept an allow list of domains via a comma-separate
    string (`DOMAIN_ALLOW_LIST`) , which includes the `API_EXTERNAL_URL` by
    default. On each request, gotrue will check that the domain being used
    is also included in the allow list.
    * When gotrue starts up, it will take the `DOMAIN_ALLOW_LIST` and
    convert it into a map where the key is the hostname and the value is the
    url
    * When a request is made to gotrue, gotrue will check the
    `DomainAllowListMap` to check if there is a matching hostname before
    allowing the request through. If there isn't a matching hostname used,
    gotrue will default to use the `API_EXTERNAL_URL` instead.
    * This helps to make gotrue usable with multiple custom domains, and
    also allows the email links to contain the custom domain.
    * Since the `EXTERNAL_XXX_REDIRECT_URI` is derived during runtime, we
    can remove that config once this PR is merged in as long as the
    `REDIRECT_URI` is also included in the `DOMAIN_ALLOW_LIST`
    
    ---------
    
    Co-authored-by: Joel Lee <lee.yi.jie.joel@gmail.com>
    kangmingtay and J0 authored May 12, 2023
    Configuration menu
    Copy the full SHA
    91a82ed View commit details
    Browse the repository at this point in the history

Commits on May 13, 2023

  1. Configuration menu
    Copy the full SHA
    2b8ba67 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2023

  1. Configuration menu
    Copy the full SHA
    23c8b45 View commit details
    Browse the repository at this point in the history
  2. feat: add mfa cleanup (supabase#1105)

    ## What kind of change does this PR introduce?
    
    This PR extends supabase#875 to clean up MFA challenges as well so that they
    don't clog the database.
    
    
    ## How this was tested
    
    set `GOTRUE_DB_CLEANUP_ENABLED = true`
    
    1. Sign up locally
    2. Enroll a factor
    3. `ab -p testfileforab -T application/json -H 'Authorization: Bearer
    <token>' -c 10 -n 100
    http://localhost:9999/factors/0bca5d9c-157a-4a15-890c-2ad33415b4f3/challenge`
    4. `update auth.mfa_challenges set created_at = created_at - interval
    '48 hours';`
    5. Make about 7 requests to ensure there's a cleanup performed
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored May 23, 2023
    Configuration menu
    Copy the full SHA
    f5c9afb View commit details
    Browse the repository at this point in the history
  3. fix: use configured redirect URL for external providers (supabase#1114)

    With supabase#999 custom domains were introduced, however for OAuth, the
    redirect URLs should in fact be the ones specified in the config and not
    ones interpreted from the `X-Forwarded-Host` header.
    hf authored May 23, 2023
    Configuration menu
    Copy the full SHA
    42bb1e0 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2023

  1. fix: ignore exchangeCodeForSession when captcha is enabled (supabase#…

    …1121)
    
    Aims to address supabase#1120 
    
    How this was tested:
    
    - Remote instance with Github OAuth. 
    
    Enable captcha
    1. Attempt to sign up w/o captcha token - this should fail
    2. Attempt to sign in with Github OAuth w/o token - this should succeed
    and session should be loaded
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
    3 people authored May 30, 2023
    Configuration menu
    Copy the full SHA
    4970bbc View commit details
    Browse the repository at this point in the history

Commits on May 31, 2023

  1. docs: clarify mailer URL path (supabase#1113)

    ## What kind of change does this PR introduce?
    
    Aims to address supabase#1111
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored May 31, 2023
    Configuration menu
    Copy the full SHA
    577a97e View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2023

  1. Configuration menu
    Copy the full SHA
    df22915 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2023

  1. feat: complete OIDC support for Apple and Google providers (supabase#…

    …1108)
    
    Previously OIDC sign in (i.e. sign-in using an ID token) for Apple,
    Google and a few other providers was not properly supported. There was
    no account linking available, and there were a few security issues found
    with the implementation.
    
    This PR attempts to resolve all of the issues, specifically targeting
    Apple and Google providers, which enables native Sign in with Apple and
    Google with mobile or desktop apps. Furthermore, this PR paves the way
    towards SSO with OIDC support.
    
    Basically, the whole `POST /token?grant_type=id_token` endpoint is
    refactored to use the central `createAccountFromExternalIdentity` method
    which supports both regular and SSO accounts with automatic account
    linking.
    
    For both Apple and Google flows, the important thing to realize is that
    their OAuth2 flows are in-fact OIDC authentication flows. The Apple
    OAuth2 flow already used the Apple OIDC ID token to extract user
    information. The Google OAuth2 flow is refactored to use the OIDC ID
    token when available (appears to be always) or fall back to the previous
    implementation.
    
    Since it does not matter whether the flow is OAuth2 or OIDC, automatic
    account linking can take place.
    
    The remaining OIDC supported providers -- Azure, Facebook, Keycloak --
    remain supported though with upgraded account linking support; however
    their implementations are best-effort at this point. Furthermore, the
    Keycloak implementation should be deprecated as it's actually solving a
    SSO-with-OIDC problem.
    hf authored Jun 7, 2023
    Configuration menu
    Copy the full SHA
    aab7c34 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2023

  1. tests: fix flaky Google ID token test (supabase#1134)

    Google seem to rotate their OIDC JWKS keys regularly, which made the
    tests fail. This time the verifier is overridden and uses a static key
    at the time of generating of the ID token.
    hf authored Jun 13, 2023
    Configuration menu
    Copy the full SHA
    8eaba35 View commit details
    Browse the repository at this point in the history
  2. feat: use otherMails with Azure (supabase#1130)

    It appears that some Azure accounts may not have an `email` claim but do
    have
    [`otherMails`](https://learn.microsoft.com/en-us/azure/active-directory-b2c/user-profile-attributes).
    GoTrue will also extract those emails and use the first one of those as
    the primary if no email is defined.
    hf authored Jun 13, 2023
    Configuration menu
    Copy the full SHA
    fba1988 View commit details
    Browse the repository at this point in the history
  3. feat: infer Mail in SAML assertion and allow deleting SSO user (sup…

    …abase#1132)
    
    PingIdentity usually sends the email address in `Mail` with capital M.
    We also are allowing deleting the user record when the user is SSO with
    the admin API.
    hf authored Jun 13, 2023
    Configuration menu
    Copy the full SHA
    47ad9de View commit details
    Browse the repository at this point in the history
  4. feat: fix SAML metadata XML update on fetched metadata (supabase#1135)

    When GoTrue needs to update the SAML metadata XML by fetching from the
    URL, there were a few issues:
    
    - `Update` was being called with a non-pointer argument which generally
    fails with a panic in Pop 😞
    - Only the `metadata_xml` and `updated_at` columns should be updated
    
    This PR fixes it.
    hf authored Jun 13, 2023
    Configuration menu
    Copy the full SHA
    aba0e24 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2023

  1. fix: duplicate identity error on update user (supabase#1141)

    ## What kind of change does this PR introduce?
    * When updating a user's email or phone number, if the user previously
    did not have an email or phone number associated to their account,
    gotrue will create an new identity for it. However, subsequent attempts
    to update the user's email or phone number will result in gotrue
    attempting to create the same identity again. This results in postgres
    returning a unique constraint violation.
    
    For example, assuming that the user signed up with email + password
    initially:
    
    ```bash
    # this request will create a phone identity and send an OTP to the user
    curl -X PUT "http://localhost:9999/user" -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"phone": "123456789"}'
    
    # this request will return a "duplicate key value violates unique constraint" error because gotrue attempts to create the same phone identity
    curl -X PUT "http://localhost:9999/user" -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"phone": "123456789"}'
    ```
    
    * ~This PR attempts to fix this issue by only creating the identity if
    the user's `phone` or `phone_change` columns are empty.~
    kangmingtay authored Jun 16, 2023
    Configuration menu
    Copy the full SHA
    39ca89c View commit details
    Browse the repository at this point in the history
  2. refactor: validate update user params separately (supabase#1144)

    ## What kind of change does this PR introduce?
    * Create a `Validate()` method to handle the validation of the request
    body separately
    * Moves some of the input validation out of the transaction into the
    `Validate()` method
    kangmingtay authored Jun 16, 2023
    Configuration menu
    Copy the full SHA
    66e5f55 View commit details
    Browse the repository at this point in the history
  3. chore(deps): bump github.com/lestrrat-go/jwx from 1.2.25 to 1.2.26 (s…

    …upabase#1138)
    
    Bumps [github.com/lestrrat-go/jwx](https://github.com/lestrrat-go/jwx)
    from 1.2.25 to 1.2.26.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/lestrrat-go/jwx/releases">github.com/lestrrat-go/jwx's
    releases</a>.</em></p>
    <blockquote>
    <h2>[SECURITY] v1.2.26</h2>
    <pre><code>v1.2.26 - 14 Jun 2023
    [Security]
    * Potential Padding Oracle Attack Vulnerability and Timing Attack
    Vulnerability
    for JWE AES-CBC encrypted payloads affecting all v2 releases up to
    v2.0.10,
    all v1 releases up to v1.2.25, and all v0 releases up to v0.9.2 have
    been reported by
        @shogo82148.
    <pre><code>Please note that v0 versions will NOT receive fixes.
    This release fixes these vulnerabilities for the v1 series.
    </code></pre>
    <p></code></pre></p>
    </blockquote>
    </details>
    <details>
    <summary>Changelog</summary>
    <p><em>Sourced from <a
    href="https://github.com/lestrrat-go/jwx/blob/v1.2.26/Changes">github.com/lestrrat-go/jwx's
    changelog</a>.</em></p>
    <blockquote>
    <p>v1.2.26 - 14 Jun 2023
    [Security]</p>
    <ul>
    <li>
    <p>Potential Padding Oracle Attack Vulnerability and Timing Attack
    Vulnerability
    for JWE AES-CBC encrypted payloads affecting all v2 releases up to
    v2.0.10,
    all v1 releases up to v1.2.25, and all v0 releases up to v0.9.2 have
    been reported by
    <a
    href="https://github.com/shogo82148"><code>@​shogo82148</code></a>.</p>
    <p>Please note that v0 versions will NOT receive fixes.
    This release fixes these vulnerabilities for the v1 series.</p>
    </li>
    </ul>
    <p>[Miscellaneous]</p>
    <ul>
    <li>JWE tests now only run algorithms that are supported by the
    underlying
    <code>jose</code> tool</li>
    </ul>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/lestrrat-go/jwx/commit/d9ddbc8e5009cfdd8c28413390b67afa7f576dd6"><code>d9ddbc8</code></a>
    merge v1 (<a
    href="https://github.com/lestrrat-go/jwx/issues/936">#936</a>)</li>
    <li>See full diff in <a
    href="https://github.com/lestrrat-go/jwx/compare/v1.2.25...v1.2.26">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/lestrrat-go/jwx&package-manager=go_modules&previous-version=1.2.25&new-version=1.2.26)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/supabase/gotrue/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jun 16, 2023
    Configuration menu
    Copy the full SHA
    b3e091f View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2023

  1. feat: return SMS ID when possible (supabase#1145)

    Returns the SMS message ID as received from the SMS sending provider in
    `/otp` and `/resend` to aid in debugging deliverability issues. Logs
    also include the message ID when available.
    hf authored Jun 19, 2023
    Configuration menu
    Copy the full SHA
    02cb927 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2023

  1. feat: add kid, iss, iat claims to the JWT (supabase#1148)

    These allow for standards compliant identification of the GoTrue server
    issuing the JWTs as well as the key it is signing the keys with.
    hf authored Jun 20, 2023
    Configuration menu
    Copy the full SHA
    3446197 View commit details
    Browse the repository at this point in the history
  2. fix: resend email change (supabase#1151)

    ## What kind of change does this PR introduce?
    * There was a regression awhile back for resending email change links so
    i've made the fix and added some tests to ensure it doesn't happen in
    the future
    kangmingtay authored Jun 20, 2023
    Configuration menu
    Copy the full SHA
    ddad10f View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2023

  1. Configuration menu
    Copy the full SHA
    e414cb3 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2023

  1. fix: check err before using user (supabase#1154)

    ## What kind of change does this PR introduce?
    * Set `IsSSOUser` field on user only after err has been checked, else
    this might result in a panic the the rare case where `models.NewUser`
    returns an error
    kangmingtay authored Jun 22, 2023
    Configuration menu
    Copy the full SHA
    53e1b3a View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2023

  1. feat: add Figma provider (supabase#1139)

    ## What kind of change does this PR introduce?
    
    Feature
    
    ## What is the current behavior?
    
    No provider for Figma.
    
    ## What is the new behavior?
    
    This PR adds a new provider for Figma.
    
    ## Additional context
    The Figma OAuth2 API only provides a single scope ("file_read"), so
    there isn't a more restrictive scope solely for getting user metadata.
    
    Figma developer reference: https://www.figma.com/developers/api#oauth2
    bnjmnt4n authored Jun 23, 2023
    Configuration menu
    Copy the full SHA
    007324c View commit details
    Browse the repository at this point in the history
  2. feat: add support for Twilio Verify (supabase#1124)

    ## What kind of change does this PR introduce?
    
    Aims to add Twilio Verify Support. Twilio Verify is implemented as a
    separate provider. Only one of Twilio Verify or Twilio Programmable
    messaging an be selected. At this time, we only support the use of the
    `whatsapp` and `sms` channels with Twilio Verify.
    
    This will affect the:
    1. Signup flow
    2. Verification flow (sms and phone_change)
    3. Resend
    
    The token is still generated, but not used in the Twilio Verify flow. It
    is used as a placeholder so as to try to ensure that to the OTP returned
    by the Verify service can only be used with the corresponding flow it
    was generated for.
    
    ## What is the current behaviour?
    
    We support programmable messaging.
    
    ## What is the new behaviour?
    
    Developer can toggle between using Twilio Programmable Messaging on all
    flows or Twilio Verify on all flows.
    
    ## Additional context
    
    Manual tests:
    
    Probably need to be conducted on both Phone Change and SMS OTP
    Verification:
    
    - [x] Existing Programmable Messaging (SMS/WhatsApp)
    (Signup/Verify/PhoneChange)
    - [x] Twilio Verify(SMS/WhatsApp) 
    - [ ] Update Frontend to include Twilio Verify
    
    Admin methods shouldn't need to be updated to send to Twilio Verify
    since admin methods don't require confirmation
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
    3 people authored Jun 23, 2023
    Configuration menu
    Copy the full SHA
    7e240f8 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2023

  1. chore: normalize line endings (supabase#1156)

    This addresses differences in eol handling between OSes by normalizing
    the line endings using a `.gitattributes` file.
    
    On Windows, cloning the repo and building the containers causes the
    Postgres container to fail to initialize and shutdown early due to
    `init_postgres.sh` being copied into the container with Windows line
    endings.
    
    Fixes supabase#1155
    
    New clones of the repo shouldn't have issues with this after this PR is
    merged. Existing clones which don't already contain `LF` line endings
    may have to reset using
    ```
    git rm --cached -r .
    git reset --hard
    ```
    to update their files' line endings.
    Sammy-T authored Jun 26, 2023
    Configuration menu
    Copy the full SHA
    534172b View commit details
    Browse the repository at this point in the history
  2. Ignore built .exe file (supabase#1157)

    Ignores the built gotrue.exe file generated on Windows.
    
    This improves development experience and repo contribution if the user
    clones the repo to a Windows environment.
    
    ## What is the current behavior?
    
    Git marks the built gotrue.exe file as untracked.
    
    ## What is the new behavior?
    
    Git ignores the gotrue.exe file as it already does with similar built
    files.
    Sammy-T authored Jun 26, 2023
    Configuration menu
    Copy the full SHA
    4111d9a View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2023

  1. feat: switch to github.com/supabase/mailme package (supabase#1159)

    Switches to github.com/supabase/mailme instead of Netlify's mailme
    package.
    
    
    Fixes:
    - supabase#870
    hf authored Jun 28, 2023
    Configuration menu
    Copy the full SHA
    dbb9cf7 View commit details
    Browse the repository at this point in the history
  2. feat: remove SafeRoundTripper and allow private-IP HTTP connections (

    …supabase#1152)
    
    Removes `SafeRoundTripper` which was a HTTP `RoundTripper` which did not
    allow establishing HTTP connections to servers listening on private IP
    addresses.
    
    This is probably inherited from the Netlify codebase, and was added as a
    safeguard to avoid cyclic requests with their hooks implementation which
    is not used by Supabase.
    
    Why it's absolutely normal to expect connections to private IP
    addresses:
    
    - Running GoTrue in Kuberenetes, AWS ECS, or other places. 
    - Local development with Docker, which loves to create virtual private
    networks inside containers all the time.
    - Caches inside VPCs.
    - Rendering templates served only within the VPC and not those that are
    publicly available.
    hf authored Jun 28, 2023
    Configuration menu
    Copy the full SHA
    773e45e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    58552d6 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2023

  1. feat: add different logout scopes (supabase#1112)

    Right now, probably due to a bug, `POST /logout` would log the user out
    from _all_ sessions they have. This is not always desired behavior.
    
    This change adds a new `scope` query param on `/logout` with these
    values:
    - `global` (default when not provided) Logs a user out from all sessions
    they have.
    - `local` Logs a user out from the current session only.
    - `others` Logs a user out from all other sessions except the current
    one.
    
    See:
    - supabase/auth-js#713
    hf authored Jul 3, 2023
    Configuration menu
    Copy the full SHA
    df07540 View commit details
    Browse the repository at this point in the history
  2. feat: refactor password changes and logout (supabase#1162)

    Centralizes the code to log out a user on password change. When an admin
    changes a password for a user, the logout is also performed now.
    hf authored Jul 3, 2023
    Configuration menu
    Copy the full SHA
    b079c35 View commit details
    Browse the repository at this point in the history
  3. fix: maintain query params order (supabase#1161)

    ## What kind of change does this PR introduce?
    * Maintains the order of the query params passed into the email link
    kangmingtay authored Jul 3, 2023
    Configuration menu
    Copy the full SHA
    c925065 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2023

  1. fix: respect last_sign_in_at on secure password update (supabase#1164)

    ## What kind of change does this PR introduce?
    * Updating a user's password should only require reauthentication if the
    current session is not recent (created more than 24hrs ago)
    kangmingtay authored Jul 4, 2023
    Configuration menu
    Copy the full SHA
    963df37 View commit details
    Browse the repository at this point in the history
  2. feat: require different passwords on update (supabase#1163)

    When the user updates their password, the new and old passwords must be
    different. When an admin does it, this is not checked.
    hf authored Jul 4, 2023
    Configuration menu
    Copy the full SHA
    154dd91 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2023

  1. feat: allow POST /verify to accept a token hash (supabase#1165)

    ## What kind of change does this PR introduce?
    * To enable server-side redirection via an email link, we need some way
    to return the session in the response body rather than in the query
    fragments (`GET /verify`) because the fragments can't be parsed on the
    server-side.
    
    * By allowing `POST /verify` to accept just a token hash, a developer
    would be able to set the verification URL in their email template to
    point to their own endpoint
    (`https://myapp.com/confirm-signup?token_hash=XXX&type=signup`) and
    parse the `token_hash` param before calling `POST /verify` with the
    following:
    
    ```bash
    curl -X POST 'http://localhost:9999/verify' -H 'Content-Type: application/json' \ 
    -d '{"token_hash": "my_token_hash", "type": "signup" }'
    ```
    
    If the token hash is valid and the request is successful, this would
    return the verified user's session in the response and the developer can
    subsequently handle any redirection on their own.
    
    ---------
    
    Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
    kangmingtay and hf authored Jul 5, 2023
    Configuration menu
    Copy the full SHA
    e9ab555 View commit details
    Browse the repository at this point in the history
  2. feat: set updated_at on refresh_tokens when revoking family (supa…

    …base#1167)
    
    `updated_at` was not being updated when the token family was being
    revoked, which makes it impossible to figure out when the revocation
    actually happened.
    hf authored Jul 5, 2023
    Configuration menu
    Copy the full SHA
    bebd27a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    87a0da0 View commit details
    Browse the repository at this point in the history
  4. refactor: simplify validation logic (supabase#1168)

    ## What kind of change does this PR introduce?
    * Simplify PKCE param validation logic
    
    ---------
    
    Co-authored-by: Joel Lee <lee.yi.jie.joel@gmail.com>
    kangmingtay and J0 authored Jul 5, 2023
    Configuration menu
    Copy the full SHA
    ce0b86d View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2023

  1. chore(deps): bump google.golang.org/grpc from 1.46.2 to 1.53.0 (supab…

    …ase#1170)
    
    Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from
    1.46.2 to 1.53.0.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/grpc/grpc-go/releases">google.golang.org/grpc's
    releases</a>.</em></p>
    <blockquote>
    <h2>Release 1.53.0</h2>
    <h1>API Changes</h1>
    <ul>
    <li>balancer: support injection of per-call metadata from LB policies
    (<a
    href="https://github.com/grpc/grpc-go/issues/5853">#5853</a>)</li>
    <li>resolver: remove deprecated field
    <code>resolver.Target.Endpoint</code> and replace with
    <code>resolver.Target.Endpoint()</code> (<a
    href="https://github.com/grpc/grpc-go/issues/5852">#5852</a>)
    <ul>
    <li>Special Thanks: <a
    href="https://github.com/kylejb"><code>@​kylejb</code></a></li>
    </ul>
    </li>
    </ul>
    <h1>New Features</h1>
    <ul>
    <li>xds/ringhash: introduce <code>GRPC_RING_HASH_CAP</code> environment
    variable to override the maximum ring size. (<a
    href="https://github.com/grpc/grpc-go/issues/5884">#5884</a>)</li>
    <li>rls: propagate headers received in RLS response to backends (<a
    href="https://github.com/grpc/grpc-go/issues/5883">#5883</a>)</li>
    </ul>
    <h1>Bug Fixes</h1>
    <ul>
    <li>transport: drain client transport when streamID approaches
    MaxStreamID (<a
    href="https://github.com/grpc/grpc-go/issues/5889">#5889</a>)</li>
    <li>server: after GracefulStop, ensure connections are closed when final
    RPC completes (<a
    href="https://github.com/grpc/grpc-go/issues/5968">#5968</a>)</li>
    <li>server: fix a few issues where grpc server uses RST_STREAM for
    non-HTTP/2 errors (<a
    href="https://github.com/grpc/grpc-go/issues/5893">#5893</a>)</li>
    <li>xdsclient: fix race which can happen when multiple load reporting
    calls are made at the same time. (<a
    href="https://github.com/grpc/grpc-go/issues/5927">#5927</a>)</li>
    <li>rls: fix a data race involving the LRU cache (<a
    href="https://github.com/grpc/grpc-go/issues/5925">#5925</a>)</li>
    <li>xds: fix panic involving double close of channel in xDS transport
    (<a
    href="https://github.com/grpc/grpc-go/issues/5959">#5959</a>)</li>
    <li>gcp/observability: update method name validation (<a
    href="https://github.com/grpc/grpc-go/issues/5951">#5951</a>)</li>
    </ul>
    <h1>Documentation</h1>
    <ul>
    <li>credentials/oauth: mark <code>NewOauthAccess</code> as deprecated
    (<a
    href="https://github.com/grpc/grpc-go/issues/5882">#5882</a>)
    <ul>
    <li>Special Thanks: <a
    href="https://github.com/buzzsurfr"><code>@​buzzsurfr</code></a></li>
    </ul>
    </li>
    </ul>
    <h2>Release 1.52.3</h2>
    <h1>Bug Fixes</h1>
    <ul>
    <li>Fix user-agent version</li>
    </ul>
    <h2>Release 1.52.2</h2>
    <h1>Bug Fixes</h1>
    <ul>
    <li>xds: fix panic involving double close of channel in xDS transport
    (<a
    href="https://github.com/grpc/grpc-go/issues/5959">#5959</a>)</li>
    </ul>
    <h2>Release 1.52.1</h2>
    <h1>Bug Fixes</h1>
    <ul>
    <li>grpclb: rename grpclbstate package back to state (<a
    href="https://github.com/grpc/grpc-go/issues/5963">#5963</a>)</li>
    </ul>
    <h2>Release 1.52.0</h2>
    <h1>New Features</h1>
    <ul>
    <li>xdsclient: log node ID with verbosity INFO (<a
    href="https://github.com/grpc/grpc-go/issues/5860">#5860</a>)</li>
    <li>ringhash: impose cap on <code>max_ring_size</code> to reduce
    possibility of OOMs (<a
    href="https://github.com/grpc/grpc-go/issues/5801">#5801</a>)</li>
    </ul>
    <h1>Behavior Changes</h1>
    <!-- raw HTML omitted -->
    </blockquote>
    <p>... (truncated)</p>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/dba26e15a07f43875ccf806a2dd6cbcbc1c12eab"><code>dba26e1</code></a>
    Change version to 1.53.0 (<a
    href="https://github.com/grpc/grpc-go/issues/5983">#5983</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/2a1e9348ff7b5d9f4b5039e84e6c9873b5b3e26e"><code>2a1e934</code></a>
    server: after GracefulStop, ensure connections are closed when final RPC
    comp...</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/e2d69aa076dd070e3668784c4dc8bcf7131b3f67"><code>e2d69aa</code></a>
    tests: fix spelling of variable (<a
    href="https://github.com/grpc/grpc-go/issues/5966">#5966</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/a6376c9893f56fc3819bee9ef5d71f55cc2d38dd"><code>a6376c9</code></a>
    xds/resolver: cleanup tests to use real xDS client 3/n (<a
    href="https://github.com/grpc/grpc-go/issues/5953">#5953</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/bf8fc46fa6eb913e4ed0f6dee6c6a7b75e85fbf0"><code>bf8fc46</code></a>
    xds/resolver: cleanup tests to use real xDS client 5/n (<a
    href="https://github.com/grpc/grpc-go/issues/5955">#5955</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/3930549b38c0fc4cd94a95efccf7cef5f90515fd"><code>3930549</code></a>
    resolver: replace resolver.Target.Endpoint field with Endpoint() method
    (<a
    href="https://github.com/grpc/grpc-go/issues/5852">#5852</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/894816c487f8dd48fc971c45a7c5baa4b86ef7de"><code>894816c</code></a>
    grpclb: rename <code>grpclbstate</code> package back to
    <code>state</code> (<a
    href="https://github.com/grpc/grpc-go/issues/5962">#5962</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/e5a0237a46a5f95fa571624929be10c7afebb180"><code>e5a0237</code></a>
    encoding: fix duplicate compressor names (<a
    href="https://github.com/grpc/grpc-go/issues/5958">#5958</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/4adb2a7a00d8b62df5ea34d520fe3ca13bffd31a"><code>4adb2a7</code></a>
    xds/resolver: cleanup tests to use real xDS client 2/n (<a
    href="https://github.com/grpc/grpc-go/issues/5952">#5952</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/52a8392f374b8cd60e176b67925a7f8c1605d014"><code>52a8392</code></a>
    gcp/observability: update method name validation (<a
    href="https://github.com/grpc/grpc-go/issues/5951">#5951</a>)</li>
    <li>Additional commits viewable in <a
    href="https://github.com/grpc/grpc-go/compare/v1.46.2...v1.53.0">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.46.2&new-version=1.53.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/supabase/gotrue/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 6, 2023
    Configuration menu
    Copy the full SHA
    153351a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3b1a5b9 View commit details
    Browse the repository at this point in the history
  3. fix: change email update flow to return both ? messages and # messages (

    supabase#1129)
    
    ## What kind of change does this PR introduce?
    
    We amend the error messages to return both ? messages and # messages
    when using the PKCE flow for backward compatibility with the client
    libraries. The client libraries will be able to fetch error message from
    error fragments with this change.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Jul 6, 2023
    Configuration menu
    Copy the full SHA
    77afd28 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2023

  1. fix: remove captcha on id_token grant (supabase#1175)

    ## What kind of change does this PR introduce?
    * Remove captcha protection on `id_token` grant since the protection is
    provided by the OIDC issuer
    * Fixes supabase#1172
    kangmingtay authored Jul 10, 2023
    Configuration menu
    Copy the full SHA
    910079c View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2023

  1. fix: support email verification type on token hash verification (supa…

    …base#1177)
    
    ## What kind of change does this PR introduce?
    * Allow `POST /verify` to accept the email verification type when used
    together with the `token_hash`
    * For example:
    ```
    curl -X POST "http://localhost:9999/verify" -H "Content-Type: application/json" -d '{"token_hash": "d00bae897e954fd46a72d72ee9e00eb3e061541413395f08f7f754c1", "type": "email"}'
    ```
    kangmingtay authored Jul 11, 2023
    Configuration menu
    Copy the full SHA
    ffa5efa View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2023

  1. feat: drop restriction that PKCE cannot be used with autoconfirm (sup…

    …abase#1176)
    
    ## What kind of change does this PR introduce?
    
    Allow autoconfirm signup to be used with PKCE. When used with PKCE,
    autoconfirm signups retain their behaviour of returning an access token
    directly
    
    ## What is the current behavior?
    
    Calling signup with autoconfirm enabled will throw an error
    
    ## What is the new behavior?
    
    Calling signup with autoconfirm enabled will return a session similar to
    implicit flow
    
    ## Additional context
    
    Linked to:
    https://github.com/supabase/gotrue/pulls?q=is%3Apr+is%3Aclosed++accept+
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Jul 12, 2023
    Configuration menu
    Copy the full SHA
    0a6f218 View commit details
    Browse the repository at this point in the history
  2. feat: remove flow state expiry on Magic Links (PKCE) (supabase#1179)

    ## What kind of change does this PR introduce?
    
    Removes the expiry on flow state which might overshadow the `OTP expiry`
    since default OTP expiry (1 day) is typically longer than default flow
    state expiry (5 mins). Flow state expiry is still enforced on token
    exchange.
    
    ## What is the current behavior?
    
    Flow state expiry is checked on verification/issuance of Auth code
    
    ## What is the new behavior?
    
    No flow state expiry check on verification of magic link. Flow state
    expiry continues to be enforced on token exchange.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Jul 12, 2023
    Configuration menu
    Copy the full SHA
    caa9393 View commit details
    Browse the repository at this point in the history
  3. docs: adding table of contents. (supabase#1180)

    ## What kind of change does this PR introduce?
    
    Docs update.
    
    ## What is the current behavior?
    
    There is no table of contents so it is not easy to search the docs.
    
    ## What is the new behavior?
    
    There is now a table of contexts for easier searching of the docs.
    
    ## Additional context
    
    N/A
    j7nw4r authored Jul 12, 2023
    Configuration menu
    Copy the full SHA
    fa5cc43 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2023

  1. fix: log correct referer value (supabase#1178)

    ## What kind of change does this PR introduce?
    * Currently, we always log
    [`r.Referer()`](https://cs.opensource.google/go/go/+/refs/tags/go1.20.5:src/net/http/request.go;l=454)
    in the gotrue logs. However, this assumes that the referrer is always
    sent in the header which is false.
    * Move the functions to get the referrer and validate the referrer to
    the `utilities` package so it can be used across the `api` and
    `observability` packages
    * Removed `getRedirectURLOrReferrer` because it's basically a repeat of
    `getReferrer`. You would still need to parse the `redirect_to` before
    calling `getRedirectURLOrReferrer` and `getReferrer` handles the parsing
    + validation for us already.
    kangmingtay authored Jul 14, 2023
    Configuration menu
    Copy the full SHA
    a6950a0 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2023

  1. fix: only apply rate limit if autoconfirm is false (supabase#1184)

    ## What kind of change does this PR introduce?
    * Rate limit for total emails / sms-es sent should only be applied when
    autoconfirm is disabled
    kangmingtay authored Jul 17, 2023
    Configuration menu
    Copy the full SHA
    46932da View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2023

  1. refactor: move refresh token grant to new file (supabase#1187)

    To make the `token.go` file less busy.
    hf authored Jul 18, 2023
    Configuration menu
    Copy the full SHA
    da96ff7 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. refactor: remove currently unused code (supabase#1189)

    ## What kind of change does this PR introduce?
    
    Removes currently unused code to improve maintainability of codebase and
    to increase code coverage. Feel free to let me know if there's anything
    people would like to keep though as some functions may have use in the
    near future.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Jul 20, 2023
    Configuration menu
    Copy the full SHA
    df8460b View commit details
    Browse the repository at this point in the history
  2. feat: serialized access to session in refresh_token grant (supabase…

    …#1190)
    
    Improves the `refresh_token` grant flow by serializing access over the
    session ID, so that a session cannot concurrently be refreshed.
    
    It achieves this by adding a boolean `forUpdate` parameter to
    `models.FindSessionByID()` and `models.FindUserWithRefreshToken()`. This
    in turn uses a [`SELECT ... FOR
    UPDATE`](https://www.postgresql.org/docs/current/sql-select.html#SQL-FOR-UPDATE-SHARE)
    query that locks the row from use with other flows that select it with a
    `FOR UPDATE` clause.
    hf authored Jul 20, 2023
    Configuration menu
    Copy the full SHA
    a8f1712 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2023

  1. refactor: drop string cast on withDefault (supabase#1193)

    ## What kind of change does this PR introduce?
    
    withDefault returns a string, so cast isn't strictly needed
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Jul 21, 2023
    Configuration menu
    Copy the full SHA
    5bb5db2 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2023

  1. refactor: replace fmt.Sprintf with generateTokenHash (supabase#1195)

    ## What kind of change does this PR introduce?
    
    see title -  relevant command:
    ```
    #!/bin/bash
    
    # Function to apply sed command to files in a directory
    replace_in_files() {
      # The sed command with the pattern for replacement
      sed -E -i '' 's/fmt\.Sprintf\("%x", sha256\.Sum224\(\[\]byte\(([^+]+)\+([^)]+)\)\)\)/crypto.GenerateTokenHash(\1, \2)/g' "$1"
    }
    
    # Check if a directory is provided as an argument
    if [ -z "$1" ]; then
      echo "Please provide the directory path as an argument."
      exit 1
    fi
    
    # Check if the directory exists
    if [ ! -d "$1" ]; then
      echo "Directory not found: $1"
      exit 1
    fi
    
    # Loop through all files in the directory and apply the sed command
    for file in "$1"/*; do
      if [ -f "$file" ]; then
        replace_in_files "$file"
      fi
    done
    ```
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Jul 22, 2023
    Configuration menu
    Copy the full SHA
    ee78f36 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2023

  1. fix: use started transaction, not a new one (supabase#1196)

    Should be using `tx` in refresh token grant instead of `db`. Thanks
    @bnjmnt4n for [spotting
    this](supabase#1190 (comment)).
    hf authored Jul 24, 2023
    Configuration menu
    Copy the full SHA
    0b5b656 View commit details
    Browse the repository at this point in the history
  2. feat: add CORS allowed headers config (supabase#1197)

    Adds a new `GOTRUE_CORS_ALLOWED_HEADERS` config option to add additional
    allowed headers when performing CORS with GoTrue.
    hf authored Jul 24, 2023
    Configuration menu
    Copy the full SHA
    7134000 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2023

  1. feat: return expires_at in addition to expires_in (supabase#1183)

    There are cases where the response for an access and refresh token takes
    more than 1 second. In such cases, `gotrue-js` will record the *expiry
    time* as the time it received the response + `expires_in`. However, this
    is not correct because the access token is likely to have already
    expired by the recorded time.
    
    With this change, `gotrue-js` can just use an `expires_at` value
    instead. `expires_in` is still sent for backward compatibility.
    hf authored Jul 25, 2023
    Configuration menu
    Copy the full SHA
    3cd4bd5 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2023

  1. feat: update github.com/rs/cors to v1.9.0 (supabase#1198)

    Was not using the latest version.
    hf authored Jul 31, 2023
    Configuration menu
    Copy the full SHA
    27d3a7f View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2023

  1. Configuration menu
    Copy the full SHA
    1802ff3 View commit details
    Browse the repository at this point in the history
  2. fix: remove redundant queries to get session (supabase#1204)

    ## What kind of change does this PR introduce?
    * We're querying for the session redundantly when we already have the
    sessionId. Every time we query for a session, it fetches all the amr
    claims tied to the session too.
    * There's no need to query for the entire session when we already have
    the session id, since the `auth.mfa_amr_claims` table already has a
    foreign-key constraint on the `auth.sessions.id` column, the insert will
    fail if the given `sessionId` doesn't exist
    kangmingtay authored Aug 1, 2023
    Configuration menu
    Copy the full SHA
    669ce97 View commit details
    Browse the repository at this point in the history
  3. feat: add test OTP support for mobile app reviews (supabase#1166)

    When developers build mobile apps that use phone login, they need to
    provide pre-determined phone numbers and OTPs that will work so that
    automated and manual app reviewers (that work at Apple's AppStore or
    Google's Play Store) can test and confirm compliance with the phone
    system.
    
    Those reviewers / systems cannot be expected to provide their own phone
    number.
    
    Developers can thus set up the following environment variable:
    
    ```
    GOTRUE_EXTERNAL_SMS_TEST_OTP="<phone-1>=<otp-1>, <phone-2>=<otp-2>..."
    GOTRUE_EXTERNAL_SMS_TEST_OTP_VALID_UNTIL="<ISO date time>"
    ```
    
    SMS messages are not sent to those test phone numbers. Furthermore after
    the validity period has expired, they will automatically not be used.
    This enhances the security so that people don't forget test OTPs
    accidentally.
    
    Incidentally this makes it possible to use phone number logins when
    developing locally.
    hf authored Aug 1, 2023
    Configuration menu
    Copy the full SHA
    2fb0cf5 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2023

  1. feat: allow whatsapp channels with Twilio Verify (supabase#1207)

    WhatsApp is supported by Twilio Verify but we've missed the validation
    here.
    hf authored Aug 2, 2023
    Configuration menu
    Copy the full SHA
    ff98d2f View commit details
    Browse the repository at this point in the history
  2. feat: retry concurrent refresh token attempts (supabase#1202)

    With supabase#1190 each refresh token request was serialized with other such
    requests. However, in cases where there's a not-insignificant number of
    parallel refresh token requests for the same refresh token, a situation
    arises where a significant number of connections are opened against the
    database that perform little work. Furthermore, if GoTrue is configured
    with a bounded connection pool, this could lead to significantly reduced
    performance of the server.
    
    With these changes, when `SELECT ... FOR UPDATE` is used on the refresh
    token and session row, it is now done using the `SKIP LOCKED` clause. If
    one or both of those rows are already locked, GoTrue will immediately
    release the database connection, wait 10-30 ms and try to refresh the
    token again. If after 5s the lock cannot be acquired, a HTTP 409
    Conflict error will be returned. Clients should consider waiting at
    least a few seconds before retrying on this error.
    hf authored Aug 2, 2023
    Configuration menu
    Copy the full SHA
    d894012 View commit details
    Browse the repository at this point in the history
  3. fix: support message IDs for Twilio Whatsapp (supabase#1203)

    Support the use of Message IDs for Twilio Programmable Messaging on the
    WhatsApp channel. Arising from a customer request during their launch.
    
    The`whatsapp:` channel currently only works when using a phone number in
    the Message Service ID field. It was assumed that developers would only
    wish to use `whatsapp` channel with a phone number.
    
    However, customers may wish to use
    [Geomatch](https://support.twilio.com/hc/en-us/articles/223181268-What-is-Geomatch-and-how-does-it-work-)
    in order to use both SMS and WhatsApp channels. When using Geomatch,
    Twilio will select the best suited number within the Sender pool of the
    Message Service and use that as the sender. For instance, if sending to
    the UK and there is a UK number Twilio and a German number will likely
    the UK number over the German number.
    
    As Geomatch only works with Message IDs we need to add support for using
    MessageIDs on the `whatsapp` channel on Programmable Messaging.
    
    
    Not needed for Twilio Verify as Twilio Verify does not require the
    channel to be prefixed before a phone number.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Aug 2, 2023
    Configuration menu
    Copy the full SHA
    77e85c8 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2023

  1. feat: use template/text instead of strings.Replace for phone OTP …

    …messages (supabase#1188)
    
    ## What kind of change does this PR introduce?
    
    As per microtask, refactors the way in which we generate the sms message
    template.
    
    Cautionary note: if merged, an error will be thrown if a Key other than
    Code is placed into the SMS template (e.g. `Your code is {{ .Code}} and
    {{ .SomeOtherKey}}`) and an attempt to send SMS is made. While users
    hopefully do not have such templates we will need to update the FE input
    to guard agains this
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Aug 3, 2023
    Configuration menu
    Copy the full SHA
    5caacc1 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2023

  1. fix: improve default settings used

    ## What kind of change does this PR introduce?
    
    Bug fix, setting sane defaults
    
    ## What is the current behavior?
    supabase#1194
    
    - If the configuration API_EXTERNAL_URL is not set requests to gotrue
    return 500 errors. This configuration was undocumented and only part of
    some examplary configurations.
    
    - If the URLPaths for the Mailer are not set they defaulted to / which
    by default is not the correct endpoint to handle verification requests.
    
    ## What is the new behavior?
    
    - API_EXTERNAL_URL needs to be set for gotrue to start.
    - URLPaths for Invite,Confirmation,Recovery and EmailChange are set to
    "/verify" by default instead of "/"
    aurifi authored Aug 7, 2023
    Configuration menu
    Copy the full SHA
    4745451 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2023

  1. refactor: centralize metric counter to observability package (supabas…

    …e#1213)
    
    - Move metric counter to observability package so that we can reuse it
    to track other metrics
    - Rename `NetlifyMicroserviceClaims` to `AuthMicroserviceClaims`
    
    
    Supports the email rate limit task
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Aug 8, 2023
    Configuration menu
    Copy the full SHA
    dbee2fe View commit details
    Browse the repository at this point in the history
  2. feat: add email rate limit breach metric (supabase#1208)

    ## What kind of change does this PR introduce?
    
    This PR aims to expose a set of email rate limit metrics as a Prometheus
    metric that can then be consumed by an alerting system like Prometheus.
    When a rate limit is triggered we increment a counter. This can then be
    passed to a monitoring system such as Prometheus alert manager which can
    fire off a notification (or similar) when a threshold (say 5 occurrences
    in an hour) has been breached.
    
    Extends: supabase#1213 
    
    
    The presence of the metric was tested via using the default
    `prometheus.yml` file that comes on download. To test that the rate
    limit is firing, we decreased `GOTRUE_RATE_LIMIT_EMAIL_SENT="5"` to 5
    and ran `ab` against the endpoint like
    
    `ab -p mass_signup.txt -T application/json -c 10 -n 50
    http://localhost:9999/otp`
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Aug 8, 2023
    Configuration menu
    Copy the full SHA
    4ff1fe0 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2023

  1. fix: set the otp if it's not a test otp (supabase#1223)

    ## What kind of change does this PR introduce?
    * OTP should be test if not using the test OTP
    
    ---------
    
    Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
    kangmingtay and hf authored Aug 17, 2023
    Configuration menu
    Copy the full SHA
    3afc8a9 View commit details
    Browse the repository at this point in the history
  2. chore: amend email and phone enabled checks on resend (supabase#1221)

    ## What kind of change does this PR introduce?
    
    Move the check for whether email logins are enabled into the resend
    function. Also checks if Phone Logins are enabled before proceeding to
    resend
    
    ## What is the current behavior?
    
    Currently, the check is done in middleware. This would mean that resend
    requests with phone based logins will not go through if email logins are
    disabled.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Aug 17, 2023
    Configuration menu
    Copy the full SHA
    943abc1 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2023

  1. feat: add sso pkce (supabase#1137)

    ## What kind of change does this PR introduce?
    
    Adds support for PKCE to the SSO flow
    
    - We don't introduce a foreign key since we can have relay states which
    use the implicit flow and won't have an associated flow state.
    
    How this was tested:
    - On staging with Okta as IDP, on an instance with the branch version of
    GoTrue uploaded
    
    GoTrue-js PR:
    - supabase/auth-js#707
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Aug 23, 2023
    Configuration menu
    Copy the full SHA
    2c0e0a1 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2023

  1. feat: expose email address being sent to for email change flow (supab…

    …ase#1231)
    
    ## What kind of change does this PR introduce?
    - Exposes the email address that we're sending to so that devs can
    customize the email conditionally
    
    ### Follow Up Tasks
    - [x] [Update Docs around Email Templates and Update Dashboard to
    reflect that the SendingTo parameter
    exists](https://github.com/supabase/supabase/blob/master/studio/stores/authConfig/schema/AuthProviders/AuthTemplatesValidation.tsx#L128)
    See [the dashboard PR](supabase/supabase#16970)
    
    ### How this was tested
    
    Build and update a staging project to use the GoTrue binary from this
    branch.
    
    On staging, add `{{.SendingTo}}` as a parameter and execute email
    change. Confirm that the parameter is parsed on both emails when using
    secure email change.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
    3 people authored Aug 30, 2023
    Configuration menu
    Copy the full SHA
    f7308ad View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2023

  1. feat: fix empty string parsing for GOTRUE_SMS_TEST_OTP_VALID_UNTIL (s…

    …upabase#1234)
    
    Fixes an issue when `GOTRUE_SMS_TEST_OTP_VALID_UNTIL=""` the
    [time.Time.UnmarshalText()](https://pkg.go.dev/time#Time.UnmarshalText)
    function is called which does not handle empty strings. An empty string
    generally means unset.
    
    Note that `*time.Time` would not work for the same reason.
    hf authored Sep 4, 2023
    Configuration menu
    Copy the full SHA
    25f2dcb View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2023

  1. fix: patch secure email change (double confirm) response format. (sup…

    …abase#1241)
    
    ## What kind of change does this PR introduce?
    
    There are two issues the PR aims to resolve:
    
    1. Currently, a Token Hash can be re-used twice in place of using the
    token hash send to the new email and a token has in the current mail. A
    solve attempt was originally made in supabase#1240 but a test was added in this
    branch.
    
    2. Currently, the single confirmation response is slightly misformed and
    has an additional null param
    
    <img width="1062" alt="CleanShot 2023-09-04 at 15 47 04@2x"
    src="https://github.com/supabase/gotrue/assets/8011761/69da91e5-e646-4970-8e80-1659e2e3fd41">
    
    This stems from the return in the transaction. sendJSON doesn't return
    an error. Consequently, he error returned by the transaction will be
    nil. This leads to
    
    <img width="755" alt="CleanShot 2023-09-04 at 15 47 41@2x"
    src="https://github.com/supabase/gotrue/assets/8011761/af583492-1aac-4cbd-aaad-856282cce808">
    
    `sendJSON(w, http.StatusOK, token)` being run after `sendJSON` is
    callled which will write the `token` (`nil` in this case) to the
    existing singleConfirmationResponse. This in turn affects returned
    response for the first confirmation as the client library is unable to
    unpack the returned JSON with extra null leading to an error.
    
    
    ## What is the new behavior?
    
    Returns response
    <img width="617" alt="CleanShot 2023-09-04 at 15 50 07@2x"
    src="https://github.com/supabase/gotrue/assets/8011761/e27db0ab-0489-4cda-a25f-8a650db5cab1">
    
    ## Additional context
    
    TODO
    - [x] Need to complete a test for the SecureEmailChange TokenHash to
    prevent a regression
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Sep 6, 2023
    Configuration menu
    Copy the full SHA
    064e8a1 View commit details
    Browse the repository at this point in the history
  2. fix: pass through redirect query parameters (supabase#1224)

    ## What kind of change does this PR introduce?
    
    Aims to address supabase#1150 so that we can pass redirect query parameters
    alongside errors. Note that if any of the existing query parameters are
    named `error` or `error_description` they will be overwritten. In such
    cases, the error added by Supabase Auth will take precedence
    
    
    ## What is the current behavior?
    
    When an error occurs the redirect query params only return error and
    error_description without other query parameters.
    
    
    ## How this was tested
    - Case with Error was induced by artifically returning an error in
    `internalExternalProviderCallback`
    - Happy path was tested as per normal
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Sep 6, 2023
    Configuration menu
    Copy the full SHA
    577e320 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. feat: add index on user_id of mfa_factors (supabase#1247)

    ## What kind of change does this PR introduce?
    
    see title, supports [this internal
    PR](https://github.com/supabase/infrastructure/pull/14835/files) among
    other things
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Sep 15, 2023
    Configuration menu
    Copy the full SHA
    6ea135a View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2023

  1. feat: add new Linkedin OIDC due to deprecated scopes for new linkedin…

    … applications (supabase#1248)
    
    ## What kind of change does this PR introduce?
    
    This PR introduces a new linkedin provider to address issues related to
    the current LinkedIn provider no longer being available for new
    applications.
    
    ## What is the current behavior?
    
    LinkedIn applications created after 1st of August experience
    difficulties while attempting to log in with GoTrue due to incorrect
    scope requests.
    
    Relevant issue:
    supabase#1216 (comment)
    Relevant initial fix however would lead to breaking existing apps -
    supabase#1232
    
    ## What is the new behavior?
    
    This PR aims to rectify the issue by adding a new provider with the
    updated OAuth scopes. Specifically, the scopes openid, email, and
    profile will be utilized. Additionally, the method of collecting profile
    information is updated, employing the /v2/userinfo API endpoint.
    
    Visual changes: No visual changes.
    
    ## Additional context
    
    I've taken the initial updates from PR
    supabase#1232 into the new providers
    while also adding the relevant settings and provider implementations. I
    don't know much in terms of this library so would love to get additional
    feedback.
    
    I validated that the -
    http://localhost:9999/authorize?provider=linkedin-oidc workflow worked
    locally and had the relevant information in the Claim
    
    ---------
    
    Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
    josmo and kangmingtay authored Sep 25, 2023
    Configuration menu
    Copy the full SHA
    f40acfe View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2023

  1. fix: use linkedin oidc endpoint (supabase#1254)

    ## What kind of change does this PR introduce?
    * Add OIDC support for the linkedin provider as highlighted
    [here](https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2#validating-id-tokens)
    * Addresses supabase#1216
    kangmingtay authored Sep 26, 2023
    Configuration menu
    Copy the full SHA
    6d5c8eb View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2023

  1. Configuration menu
    Copy the full SHA
    52d9df7 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2023

  1. feat: upgrade whatsapp support on Twilio Programmable Messaging (supa…

    …base#1249)
    
    ## What kind of change does this PR introduce?
    
    As of October, Meta will be having a separate category [for billing
    authentication related templates (such as
    OTP)](https://support.twilio.com/hc/en-us/articles/13550552351771-Notice-Changes-to-WhatsApp-Template-Approval-Workflows-April-2023-).
    Consequently, it looks like WhatsApp Authentication templates need to be
    [submitted for approval via the content
    API](https://www.twilio.com/docs/content/whatsappauthentication?code-sample=code-sending-wa-authentication-templates&code-language=Go&code-sdk-version=1.x).
    
    Consequently, there are two new parameters `ContentSID` and
    `ContentVariables` that need to be passed in. `ContentVariables`
    contains the OTP and can be passed down from the calling functions.
    These parameters are needed in order to allow for WhatsApp use on Twilio
    Programmable Messaging after October
    
    According to Twilio Support, Twilio Verify is unaffected by this change.
    
    ## What is the current behavior?
    
    Programmable Messaging will use WhatsApp templates from Twilio Dashboard
    
    ## What is the new behavior?
    
    Programmable Messaging (WhatsApp) will use templates from Content API
    
    ## Additional context
    
    - It looks like [message Content on WhatsApp will be largely
    standardized](https://www.twilio.com/docs/content/whatsappauthentication)
    so message content can't be customized.
    
    >Unlike other templates the body is preset by WhatsApp. Some
    modifications can be made by specifying certain parameters however
    custom authentication templates are not allowed.
    
    will need to call this out on the dashboard
    
    - This was tested manually by sending an OTP via toy application
    
    
    ## FLUPs required
    - [ ] Update Dashboard to include `ContentSID`
    - [ ] Update Twilio Programmable Messaging to advise users to submit
    templates for approval. Also advise devs that they will have to move any
    internationalization logic until further notice. They will also need to
    re-submit respective templates in each language. This also means that
    devs using WhatsApp with programmable messaging will only be able to use
    one language (English) unless we pass contentSID in as a parameter
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Sep 29, 2023
    Configuration menu
    Copy the full SHA
    c58febe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    05edd15 View commit details
    Browse the repository at this point in the history
  3. fix: take into account test otp for twilio verify (supabase#1255)

    ## What kind of change does this PR introduce?
    
    see title, aims to address supabase#1252 and
    supabase/auth-js#787
    
    
    TODOs:
    
    - [x] conduct an end to end test of the PR
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Sep 29, 2023
    Configuration menu
    Copy the full SHA
    18b4291 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ab2aba6 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2023

  1. Revert "feat: upgrade whatsapp support on Twilio Programmable Messagi… (

    supabase#1263)
    
    …ng (supabase#1249)"
    
    This reverts commit c58febe.
    
    Twilio recently
    [updated](https://support.twilio.com/hc/en-us/articles/15596541039771-New-WhatsApp-Authentication-Template-Requirements-May-2023)
    that they will support the basic, legacy, message for WhatsApp Twilio
    API (e.g. "Your Code is 123456") This means that existing devs using
    WhatsApp should be able to continue to use WhatsApp if they don't
    require customization in the message (e.g. "Your Code is 123456, for
    more information visit bestboats.com"). In the latter use case,
    developers can opt to make use of Twilio Verify which has limited
    restrictions around template structure
    
    Devs will more advanced use cases can move to Twilio Verify
    
    ## What kind of change does this PR introduce?
    
    Bug fix, feature, docs update, ...
    
    ## What is the current behavior?
    
    Please link any relevant issues here.
    
    ## What is the new behavior?
    
    Feel free to include screenshots if it includes visual changes.
    
    ## Additional context
    
    Add any other context or screenshots.
    J0 authored Oct 3, 2023
    Configuration menu
    Copy the full SHA
    12bfe1e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0fe4285 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2023

  1. feat: initial fix for invite followed by signup. (supabase#1262)

    ## What kind of change does this PR introduce?
    
    Currently, sending an `invite` request followed by a `signup` request
    w/o confirmation between invite and signup will expose metadata on
    UserMetadata and Identities which may be perceived as a leak of
    sensitive information.
    
    This PR aims to clear out such metadata for cases where the dev has been
    invited before a signup
    
    
    ## Testing Instructions
    How to test locally:
    
    Use this admin bearer `jwt` 
    
    1. Call  http://localhost:9999/invite to `myemail@gmail.com`
    2. Wait 60s 
    3. Call http://localhost:9999/signup with `myemail@gmail.com` and check
    that `identities` field is blanked out
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
    3 people authored Oct 9, 2023
    Configuration menu
    Copy the full SHA
    76c8eeb View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. feat: reinstate upgrade whatsapp support on Twilio Programmable Messa…

    …ging to support Content API (supabase#1266)
    
    Resinstates WhatsApp support for the content API by reinstating:
    supabase#1249
    
    
    After further discussion, it looks like we do have users who are using
    custom SMS templates (e.g. "Your <company> code is {{.code}} ")
    
    We were notified that this is required as alphanumeric senders require
    the company name in the message. This means we will need to support the
    Content API as custom messages aren't allowed under Programmable
    Messaging API + WhatsApp Template
    
    
    There will be 2 more PRs after this:
    1. PR to allow for backward compatibility with Basic Authentication
    Template
    2. PR to add ContentSid env var
    3. Dashboard PR to expose variable
    J0 authored Oct 10, 2023
    Configuration menu
    Copy the full SHA
    00ee75c View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2023

  1. fix: remove organizations from fly provider (supabase#1267)

    ## What kind of change does this PR introduce?
    * Organization info is not needed
    kangmingtay authored Oct 11, 2023
    Configuration menu
    Copy the full SHA
    c79fc6e View commit details
    Browse the repository at this point in the history
  2. fix: preserve backward compatibility with Twilio Existing API (supaba…

    …se#1260)
    
    ## What kind of change does this PR introduce?
    
    Twilio has come back with clarification that Legacy WhatsApp Template
    can contain compliant authentication template
    
    > The compliant authentication template format is supported in Content
    API, Content Editor and Legacy WhatsApp Templates.
    
    > Legacy Templates: Support for basic authentication message only.
    
    This means that we'd have to preserve support for messages which don't
    include ContentSid/ContentVariables. Namely this would be messages which
    are using the Legacy WhatsApp template with the message: `*{{1}}* is
    your verification code. For your security, do not share this code.` . It
    seems like anything else will be rejected.
    
    Full article:
    https://support.twilio.com/hc/en-us/articles/15596541039771-New-WhatsApp-Authentication-Template-Requirements-May-2023
    
    <img width="673" alt="CleanShot 2023-10-10 at 23 30 08@2x"
    src="https://github.com/supabase/gotrue/assets/8011761/c8028671-9b91-484e-9223-15da25eddfa6">
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Oct 11, 2023
    Configuration menu
    Copy the full SHA
    71fb156 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2023

  1. chore(deps): bump golang.org/x/net from 0.10.0 to 0.17.0 (supabase#1268)

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to
    0.17.0.
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/golang/net/commit/b225e7ca6dde1ef5a5ae5ce922861bda011cfabd"><code>b225e7c</code></a>
    http2: limit maximum handler goroutines to MaxConcurrentStreams</li>
    <li><a
    href="https://github.com/golang/net/commit/88194ad8ab44a02ea952c169883c3f57db6cf9f4"><code>88194ad</code></a>
    go.mod: update golang.org/x dependencies</li>
    <li><a
    href="https://github.com/golang/net/commit/2b60a61f1e4cf3a5ecded0bd7e77ea168289e6de"><code>2b60a61</code></a>
    quic: fix several bugs in flow control accounting</li>
    <li><a
    href="https://github.com/golang/net/commit/73d82efb96cacc0c378bc150b56675fc191894b9"><code>73d82ef</code></a>
    quic: handle DATA_BLOCKED frames</li>
    <li><a
    href="https://github.com/golang/net/commit/5d5a036a503f8accd748f7453c0162115187be13"><code>5d5a036</code></a>
    quic: handle streams moving from the data queue to the meta queue</li>
    <li><a
    href="https://github.com/golang/net/commit/350aad2603e57013fafb1a9e2089a382fe67dc80"><code>350aad2</code></a>
    quic: correctly extend peer's flow control window after MAX_DATA</li>
    <li><a
    href="https://github.com/golang/net/commit/21814e71db756f39b69fb1a3e06350fa555a79b1"><code>21814e7</code></a>
    quic: validate connection id transport parameters</li>
    <li><a
    href="https://github.com/golang/net/commit/a600b3518eed7a9a4e24380b4b249cb986d9b64d"><code>a600b35</code></a>
    quic: avoid redundant MAX_DATA updates</li>
    <li><a
    href="https://github.com/golang/net/commit/ea633599b58dc6a50d33c7f5438edfaa8bc313df"><code>ea63359</code></a>
    http2: check stream body is present on read timeout</li>
    <li><a
    href="https://github.com/golang/net/commit/ddd8598e5694aa5e966e44573a53e895f6fa5eb2"><code>ddd8598</code></a>
    quic: version negotiation</li>
    <li>Additional commits viewable in <a
    href="https://github.com/golang/net/compare/v0.10.0...v0.17.0">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/net&package-manager=go_modules&previous-version=0.10.0&new-version=0.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/supabase/gotrue/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Oct 12, 2023
    Configuration menu
    Copy the full SHA
    482cbff View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. feat: use OIDC ID token for Azure (supabase#1269)

    Use the OIDC ID token instead of the UserInfo endpoint, as there are
    serious discrepancies between what is returned.
    
    ---------
    
    Co-authored-by: Joel Lee <lee.yi.jie.joel@gmail.com>
    hf and J0 authored Oct 16, 2023
    Configuration menu
    Copy the full SHA
    57e336e View commit details
    Browse the repository at this point in the history
  2. feat: add GOTRUE_<PROVIDER>_SKIP_NONCE_CHECK to skip nonce checks i…

    …n ODIC flow (supabase#1264)
    
    It appears that in certain client libraries that deal with the OIDC
    authentication flow, such as [this one for React Native on
    iOS](google/GoogleSignIn-iOS#244), the clients
    are unable to extract the nonce that is generated randomly by the
    library.
    
    This option allows to temporarily drop the enforcement at the GoTrue
    level when performing the OIDC flow. This does remove an important
    security barrier, which could potentially allow "stolen" ID tokens to be
    used on third-party services (that have opted in to this configuration)
    however in the interest of flexibility and broad platform support the
    option is being added.
    hf authored Oct 16, 2023
    Configuration menu
    Copy the full SHA
    4291959 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2023

  1. feat: ignore common Azure issuer for ID tokens (supabase#1272)

    If the developer has configured `GOTRUE_AZURE_URL` to be
    `https://login.microsoftonline.com/common` then the expected issuer
    setting is set to `https://login.microsoftonline.com/common/v2.0`.
    However this is not an issuer so no ID tokens will be issued by it, but
    rather from all other multi-tenant apps and tenants, so it needs to be
    ignored from the expected issuer setting.
    hf authored Oct 17, 2023
    Configuration menu
    Copy the full SHA
    4c50357 View commit details
    Browse the repository at this point in the history
  2. fix: include /organizations in expected issuer exemption (supabase#…

    …1275)
    
    ## What kind of change does this PR introduce?
    * The issuer can also be https://login.microsoftonline.com/organizations
    for applications processing accounts in any organizational directory
    (any Microsoft Entra directory) (see
    [here](https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-convert-app-to-be-multi-tenant))
    * Fixes supabase#1274
    kangmingtay authored Oct 17, 2023
    Configuration menu
    Copy the full SHA
    47cbe6e View commit details
    Browse the repository at this point in the history
  3. chore(deps): bump github.com/crewjam/saml from 0.4.13 to 0.4.14 (supa…

    …base#1273)
    
    Bumps [github.com/crewjam/saml](https://github.com/crewjam/saml) from
    0.4.13 to 0.4.14.
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/crewjam/saml/commit/b07b16cf83c4171d16da4d85608cb827f183cd79"><code>b07b16c</code></a>
    Merge pull request from GHSA-267v-3v32-g6q5</li>
    <li><a
    href="https://github.com/crewjam/saml/commit/5f6e5ab4cdf5c62376702d00657257b7cb0f3b4d"><code>5f6e5ab</code></a>
    Bump golang.org/x/crypto (<a
    href="https://github.com/crewjam/saml/issues/538">#538</a>)</li>
    <li><a
    href="https://github.com/crewjam/saml/commit/193e551d9a8420216fae88c2b8f4b46696b7bb63"><code>193e551</code></a>
    update for most recent three go versions (<a
    href="https://github.com/crewjam/saml/issues/537">#537</a>)</li>
    <li><a
    href="https://github.com/crewjam/saml/commit/34930b26d33bfb2b3e0216c868754979e8fae7c2"><code>34930b2</code></a>
    Add support for hardware security module (HSM) signing. (<a
    href="https://github.com/crewjam/saml/issues/503">#503</a>)</li>
    <li><a
    href="https://github.com/crewjam/saml/commit/f9e67165dd9c33505409fc4ee2393528b6bdc52a"><code>f9e6716</code></a>
    Update golangci-lint version, linting fixes. (<a
    href="https://github.com/crewjam/saml/issues/511">#511</a>)</li>
    <li>See full diff in <a
    href="https://github.com/crewjam/saml/compare/v0.4.13...v0.4.14">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/crewjam/saml&package-manager=go_modules&previous-version=0.4.13&new-version=0.4.14)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/supabase/gotrue/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Oct 17, 2023
    Configuration menu
    Copy the full SHA
    c2c5f5c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    40aed62 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2023

  1. fix: supabase#1218 fixes existing migrations to allow namespaces!="au…

    …th" (supabase#1279)
    
    ## What kind of change does this PR introduce?
    
    Bug fix; Adapting existing migrations to allow other 'Namespaces' than
    Auth
    
    ## What is the current behavior?
    If a 'Namespace' (DB-Schema) other than 'auth' should be used the
    migrations fail
    
    Please link any relevant issues here.
    supabase#1218 
    
    ## What is the new behavior?
    Other db-schemas might be used for gotrue. 
    
    Feel free to include screenshots if it includes visual changes.
    
    ## Additional context
    
    Add any other context or screenshots.
    aurifi authored Oct 20, 2023
    Configuration menu
    Copy the full SHA
    206fc09 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2023

  1. feat: add idempotent refresh token algorithm (supabase#1278)

    Modifies the refresh token algorithm to support a limited form of
    idempotency. The lack of this behavior is documented to cause loss of
    session.
    
    **Problem**
    
    GoTrue, so far, assumes that clients calling the `POST
    /token?grant_type=refresh_token` endpoint are guaranteed to at least
    save the result of the response. Like all networked software, there are
    no guarantees that the sender of a request will receive the response, or
    act on it. This problem is exacerbated by network appliances like CDNs
    and reverse proxies which mask the TCP stream semantics from GoTrue. A
    properly closed TCP stream does not mean that the receiver of the
    response received the stream, but rather that a proxy in the chain
    buffered the response.
    
    Furthermore, even if the receiver is able to receive _and parse_ the
    response, usually there are no guarantees that it will continue
    processing the response. With refresh tokens, it's incredbily important
    that the receiver successfully persists the new refresh token to durable
    storage. There are no guarantees of this as browsers and mobile apps
    (and the computers they run on) can die, go offline or just malfunction
    between sending a request and processing its response.
    
    **Solution**
    
    There are really only two solutions to this problem:
    
    1. Idempotency. Where for the same inputs the same output is generated.
    2. Double-commit. Where the receipt of the response needs to be
    acknowledged before the state changes.
    
    We considered a double-commit protocol, but decided against it at this
    time as it introduces quite a bit of complexity. We may turn to it if
    the limited idempotency solution does not cover a sufficient number of
    the cases in real-world testing.
    
    **Changes**
    
    The refresh token algorithm is changed to offer a limited form of
    idempotency, such that:
    
    1. An **active refresh token** is the last non-revoked refresh token in
    a session.
    This is the token that should have been saved by the client. It can
    generally be only used once to generate a new active refresh token at
    which point it looses its status.
    2. A non-active refresh token can sometimes be used again to issue a
    valid token:
    2.1. If the non-active token is being _reused_ close to the time it was
    used again.
    2.2. **NEW** If the non-active token is the parent of the currently
    active token.
    This case adds limited idempotency by always returning the active token,
    and does not create a new active refresh token.
    hf authored Oct 23, 2023
    Configuration menu
    Copy the full SHA
    b0426c6 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2023

  1. chore(deps): bump google.golang.org/grpc from 1.53.0 to 1.56.3 (supab…

    …ase#1282)
    
    Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from
    1.53.0 to 1.56.3.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/grpc/grpc-go/releases">google.golang.org/grpc's
    releases</a>.</em></p>
    <blockquote>
    <h2>Release 1.56.3</h2>
    <h1>Security</h1>
    <ul>
    <li>
    <p>server: prohibit more than MaxConcurrentStreams handlers from running
    at once (CVE-2023-44487)</p>
    <p>In addition to this change, applications should ensure they do not
    leave running tasks behind related to the RPC before returning from
    method handlers, or should enforce appropriate limits on any such
    work.</p>
    </li>
    </ul>
    <h2>Release 1.56.2</h2>
    <ul>
    <li>status: To fix a panic, <code>status.FromError</code> now returns an
    error with <code>codes.Unknown</code> when the error implements the
    <code>GRPCStatus()</code> method, and calling <code>GRPCStatus()</code>
    returns <code>nil</code>. (<a
    href="https://github.com/grpc/grpc-go/issues/6374">#6374</a>)</li>
    </ul>
    <h2>Release 1.56.1</h2>
    <ul>
    <li>client: handle empty address lists correctly in
    addrConn.updateAddrs</li>
    </ul>
    <h2>Release 1.56.0</h2>
    <h1>New Features</h1>
    <ul>
    <li>client: support channel idleness using <code>WithIdleTimeout</code>
    dial option (<a
    href="https://github.com/grpc/grpc-go/issues/6263">#6263</a>)
    <ul>
    <li>This feature is currently disabled by default, but will be enabled
    with a 30 minute default in the future.</li>
    </ul>
    </li>
    <li>client: when using pickfirst, keep channel state in
    TRANSIENT_FAILURE until it becomes READY (<a
    href="https://github.com/grpc/proposal/blob/master/A62-pick-first.md">gRFC
    A62</a>) (<a
    href="https://github.com/grpc/grpc-go/issues/6306">#6306</a>)</li>
    <li>xds: Add support for Custom LB Policies (<a
    href="https://github.com/grpc/proposal/blob/master/A52-xds-custom-lb-policies.md">gRFC
    A52</a>) (<a
    href="https://github.com/grpc/grpc-go/issues/6224">#6224</a>)</li>
    <li>xds: support pick_first Custom LB policy (<a
    href="https://github.com/grpc/proposal/blob/master/A62-pick-first.md">gRFC
    A62</a>) (<a
    href="https://github.com/grpc/grpc-go/issues/6314">#6314</a>)
    (<a
    href="https://github.com/grpc/grpc-go/issues/6317">#6317</a>)</li>
    <li>client: add support for pickfirst address shuffling (<a
    href="https://github.com/grpc/proposal/blob/master/A62-pick-first.md">gRFC
    A62</a>) (<a
    href="https://github.com/grpc/grpc-go/issues/6311">#6311</a>)</li>
    <li>xds: Add support for String Matcher Header Matcher in RDS (<a
    href="https://github.com/grpc/grpc-go/issues/6313">#6313</a>)</li>
    <li>xds/outlierdetection: Add Channelz Logger to Outlier Detection LB
    (<a
    href="https://github.com/grpc/grpc-go/issues/6145">#6145</a>)
    <ul>
    <li>Special Thanks: <a
    href="https://github.com/s-matyukevich"><code>@​s-matyukevich</code></a></li>
    </ul>
    </li>
    <li>xds: enable RLS in xDS by default (<a
    href="https://github.com/grpc/grpc-go/issues/6343">#6343</a>)</li>
    <li>orca: add support for application_utilization field and missing
    range checks on several metrics setters</li>
    <li>balancer/weightedroundrobin: add new LB policy for balancing between
    backends based on their load reports (<a
    href="https://github.com/grpc/proposal/blob/master/A58-client-side-weighted-round-robin-lb-policy.md">gRFC
    A58</a>) (<a
    href="https://github.com/grpc/grpc-go/issues/6241">#6241</a>)</li>
    <li>authz: add conversion of json to RBAC Audit Logging config (<a
    href="https://github.com/grpc/grpc-go/issues/6192">#6192</a>)</li>
    <li>authz: add support for stdout logger (<a
    href="https://github.com/grpc/grpc-go/issues/6230">#6230</a>
    and <a
    href="https://github.com/grpc/grpc-go/issues/6298">#6298</a>)</li>
    <li>authz: support customizable audit functionality for authorization
    policy (<a
    href="https://github.com/grpc/grpc-go/issues/6192">#6192</a> <a
    href="https://github.com/grpc/grpc-go/issues/6230">#6230</a> <a
    href="https://github.com/grpc/grpc-go/issues/6298">#6298</a> <a
    href="https://github.com/grpc/grpc-go/issues/6158">#6158</a> <a
    href="https://github.com/grpc/grpc-go/issues/6304">#6304</a>
    and <a
    href="https://github.com/grpc/grpc-go/issues/6225">#6225</a>)</li>
    </ul>
    <h1>Bug Fixes</h1>
    <ul>
    <li>orca: fix a race at startup of out-of-band metric subscriptions that
    would cause the report interval to request 0 (<a
    href="https://github.com/grpc/grpc-go/issues/6245">#6245</a>)</li>
    <li>xds/xdsresource: Fix Outlier Detection Config Handling and correctly
    set xDS Defaults (<a
    href="https://github.com/grpc/grpc-go/issues/6361">#6361</a>)</li>
    <li>xds/outlierdetection: Fix Outlier Detection Config Handling by
    setting defaults in ParseConfig() (<a
    href="https://github.com/grpc/grpc-go/issues/6361">#6361</a>)</li>
    </ul>
    <h1>API Changes</h1>
    <ul>
    <li>orca: allow a ServerMetricsProvider to be passed to the ORCA service
    and ServerOption (<a
    href="https://github.com/grpc/grpc-go/issues/6223">#6223</a>)</li>
    </ul>
    <h2>Release 1.55.1</h2>
    <ul>
    <li>status: To fix a panic, <code>status.FromError</code> now returns an
    error with <code>codes.Unknown</code> when the error implements the
    <code>GRPCStatus()</code> method, and calling <code>GRPCStatus()</code>
    returns <code>nil</code>. (<a
    href="https://github.com/grpc/grpc-go/issues/6374">#6374</a>)</li>
    </ul>
    <h2>Release 1.55.0</h2>
    <h1>Behavior Changes</h1>
    <ul>
    <li>xds: enable federation support by default (<a
    href="https://github.com/grpc/grpc-go/issues/6151">#6151</a>)</li>
    <li>status: <code>status.Code</code> and <code>status.FromError</code>
    handle wrapped errors (<a
    href="https://github.com/grpc/grpc-go/issues/6031">#6031</a>
    and <a
    href="https://github.com/grpc/grpc-go/issues/6150">#6150</a>)</li>
    </ul>
    <!-- raw HTML omitted -->
    </blockquote>
    <p>... (truncated)</p>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/1055b481ed2204a29d233286b9b50c42b63f8825"><code>1055b48</code></a>
    Update version.go to 1.56.3 (<a
    href="https://github.com/grpc/grpc-go/issues/6713">#6713</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/5efd7bd73e11fea58d1c7f1c110902e78a286299"><code>5efd7bd</code></a>
    server: prohibit more than MaxConcurrentStreams handlers from running at
    once...</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/bd1f038e7234580c2694e433bec5cd97e7b7f662"><code>bd1f038</code></a>
    Upgrade version.go to 1.56.3-dev (<a
    href="https://github.com/grpc/grpc-go/issues/6434">#6434</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/faab8736bf73291f92b867d5dae31c927d53d508"><code>faab873</code></a>
    Update version.go to v1.56.2 (<a
    href="https://github.com/grpc/grpc-go/issues/6432">#6432</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/6b0b291d79831b1c8caafceec268b82c92253f96"><code>6b0b291</code></a>
    status: fix panic when servers return a wrapped error with status OK (<a
    href="https://github.com/grpc/grpc-go/issues/6374">#6374</a>)
    ...</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/ed56401aa514462d5371713b8ec5c889da33953c"><code>ed56401</code></a>
    [PSM interop] Don't fail target if sub-target already failed (<a
    href="https://github.com/grpc/grpc-go/issues/6390">#6390</a>)
    (<a
    href="https://github.com/grpc/grpc-go/issues/6405">#6405</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/cd6a794f0bdcf9a216e8f4d3c5717faf96d9fd78"><code>cd6a794</code></a>
    Update version.go to v1.56.2-dev (<a
    href="https://github.com/grpc/grpc-go/issues/6387">#6387</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/5b67e5ea449ef0686a0c0b6de48cd4cb63e3db2a"><code>5b67e5e</code></a>
    Update version.go to v1.56.1 (<a
    href="https://github.com/grpc/grpc-go/issues/6386">#6386</a>)</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/d0f5150384a87f9fcac488a9c18727a55b7354c1"><code>d0f5150</code></a>
    client: handle empty address lists correctly in addrConn.updateAddrs (<a
    href="https://github.com/grpc/grpc-go/issues/6354">#6354</a>)
    ...</li>
    <li><a
    href="https://github.com/grpc/grpc-go/commit/997c1ea101cc5d496d2b148388f1df49632a9171"><code>997c1ea</code></a>
    Change version to 1.56.1-dev (<a
    href="https://github.com/grpc/grpc-go/issues/6345">#6345</a>)</li>
    <li>Additional commits viewable in <a
    href="https://github.com/grpc/grpc-go/compare/v1.53.0...v1.56.3">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.53.0&new-version=1.56.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/supabase/gotrue/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Oct 25, 2023
    Configuration menu
    Copy the full SHA
    2385212 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2023

  1. fix: Revert "fix: remove organizations from fly provider" (supabase#1287

    )
    
    This reverts commit ef0614b.
    * Reverts this PR: supabase#1267
    kangmingtay authored Oct 30, 2023
    Configuration menu
    Copy the full SHA
    84e16ed View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2023

  1. feat: add time-boxed sessions (supabase#1286)

    Adds time-boxed sessions. These sessions time-out after a fixed amount
    of time configured via the `GOTRUE_SESSIONS_TIMEBOX` property (if set).
    hf authored Nov 1, 2023
    Configuration menu
    Copy the full SHA
    9a1f461 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aafad5c View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2023

  1. fix: check for pkce prefix (supabase#1291)

    ## What kind of change does this PR introduce?
    * Fixes supabase#798 
    * When a user requests for an email change via the `updateUser` method,
    it can use either the implicit or PKCE flow. However, when we verify the
    email change token, we should be checking for the `pkce_` prefix too.
    kangmingtay authored Nov 2, 2023
    Configuration menu
    Copy the full SHA
    05c629b View commit details
    Browse the repository at this point in the history
  2. ci: bump go version to 1.21 (supabase#1285)

    Bumps CI and Dockerfiles to use version 1.21 of Go.
    hf authored Nov 2, 2023
    Configuration menu
    Copy the full SHA
    2e9ae83 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2023

  1. feat: spotify oauth (supabase#1296)

    ## What kind of change does this PR introduce?
    kangmingtay authored Nov 3, 2023
    Configuration menu
    Copy the full SHA
    cc07b4a View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2023

  1. feat: add inactivity-timeout to sessions (supabase#1288)

    Adds the ability for sessions to time-out after a period of inactivity.
    "Activity" is defined as refreshing the session.
    
    This can be configured by setting the
    `GOTRUE_SESSIONS_INACTIVITY_TIMEOUT` to a duration.
    
    Since this PR modifies the database by adding a new `refreshed_at`
    nullable column to `sessions`, it also adds some useful columns to the
    `sessions` table to track the `User-Agent` and IP address that performed
    the refresh / session creation.
    hf authored Nov 6, 2023
    Configuration menu
    Copy the full SHA
    6c8a96e View commit details
    Browse the repository at this point in the history
  2. refactor: rename Session.UpdateRefresh to UpdateRefreshInfo (supa…

    …base#1299)
    
    My previous force-push didn't succeed but I accidentally merged thinking
    it did.
    hf authored Nov 6, 2023
    Configuration menu
    Copy the full SHA
    ab7f023 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2023

  1. feat: add cleanup for session timebox and inactivity timeout (supabas…

    …e#1298)
    
    Builds on top of supabase#1288.
    
    Adds cleanup for timeboxed sessions and sessions that have expired due
    to inactivity timeout.
    
    It achieves backward compatibility with sessions that have `null` in
    `refreshed_at` by looking at the `updated_at` column of the refresh
    tokens table. This approach is the one that puts the least strain on the
    database, having considered backfilling (very expensive at least
    `O(nlogn)` over the whole refresh tokens table).
    hf authored Nov 7, 2023
    Configuration menu
    Copy the full SHA
    9226979 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2023

  1. chore: session inactivity timeout test (supabase#1303)

    ## What kind of change does this PR introduce?
    * Set inactivity timeout to nil when the test completes
    kangmingtay authored Nov 8, 2023
    Configuration menu
    Copy the full SHA
    4e382f3 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2023

  1. fix: update dependencies (1/2) (supabase#1304)

    ## What kind of change does this PR introduce?
    
    Part 1 of 2 of a PR aimed to address this issue:
    https://github.com/supabase/gotrue/security/dependabot/11 by updating
    dependencies
    ### Updates:
    - github.com/microcosm-cc/bluemonday v1.0.26 
    - go version
    
    Split into two PRs so as not to mix the changes to the OTEL packages
    with update of unrelated dependencies
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Nov 9, 2023
    Configuration menu
    Copy the full SHA
    accccee View commit details
    Browse the repository at this point in the history
  2. Update defaults for RATE_LIMIT_TOKEN_REFRESH (supabase#1302)

    ## What kind of change does this PR introduce?
    
    Change the defaults for`RATE_LIMIT_TOKEN_REFRESH` from 30 to 150 to
    allow for more token refreshes and also to match what is offered on the
    hosted platform.
    J0 authored Nov 9, 2023
    Configuration menu
    Copy the full SHA
    d0d5e5d View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2023

  1. feat: remove opentracing (supabase#1307)

    ## What kind of change does this PR introduce?
    
    As per [this PR](supabase#679) and the we
    have deprecated opentracing and are removing it in favour of
    opentelemetry.
    
    This will make the update of the opentelemetry dependcies easier as we
    no longer have to consider opentracing specific dependencies.
    
    
    Relevant internal context:
    https://supabase.slack.com/archives/C022071RB2L/p1699451083111579
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Nov 12, 2023
    Configuration menu
    Copy the full SHA
    93e5f82 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2023

  1. feat: strip user-agent from otel tracing (supabase#1309)

    Strips the `User-Agent` header so that it's not traced by OpenTelemetry,
    while making it available for the rest of the middlewares.
    
    Fixes: https://github.com/supabase/gotrue/security/dependabot/11
    hf authored Nov 14, 2023
    Configuration menu
    Copy the full SHA
    d76f439 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2023

  1. feat: add friendly name to enroll factor response (supabase#1277)

    ## What kind of change does this PR introduce?
    
    See title
     - [x] Need to update docs
     
    
    PR to update GoTrue: https://github.com/supabase/gotrue/pull/1277/files
    Docs Update: supabase#1277
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Nov 15, 2023
    Configuration menu
    Copy the full SHA
    3c72faf View commit details
    Browse the repository at this point in the history
  2. feat: add single session per user with tags support (supabase#1297)

    Enforces a single session per user with optional tags. If a session has
    a tag, only the most recently refreshed session with the same tag can be
    refreshed. If no tags are configured, then only the most recently
    refreshed session of all of the user's sessions will be refreshed.
    
    Sessions that are invalid due to inactivity or timeboxing won't be
    considered.
    hf authored Nov 15, 2023
    Configuration menu
    Copy the full SHA
    69feebc View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2023

  1. feat: allow unverified email signins (supabase#1301)

    ## What kind of change does this PR introduce?
    * If `GOTRUE_ALLOW_UNVERIFIED_EMAIL_SIGN_INS` is enabled, it will allow
    a user with an unverified email address to sign in and obtain an access
    token JWT
    * This is particularly useful for OAuth in cases where the oauth
    provider doesn't return an email address / the oauth user didn't verify
    their email address with the OAuth provider.
    * Tests that broke and needed fixing were due to these reasons:
    * `RemoveUnconfirmedIdentities` was previously buggy and shouldn't be
    retaining the user metadata of a previously unconfirmed identity
    * `GOTRUE_ALLOW_UNVERIFIED_EMAIL_SIGN_INS` is enabled by default which
    caused some tests to return an access token instead of an error for a
    user with an unverified email
    
    ## Modifications made to automatic linking algorithm
    * If the candidate identity doesn't have a verified email, the decision
    should be to create a new account.
    * If the email belongs to a user already, then we opt to create a new
    user with no email. Previously, we would attempt to create a new user
    and the db will return an error due to the partial unique constraint on
    email violation. In order to add an email to the new user, they would
    have to call update user (`PUT /user`) to add a new email.
    kangmingtay authored Nov 16, 2023
    Configuration menu
    Copy the full SHA
    94293b7 View commit details
    Browse the repository at this point in the history
  2. fix: allow transactions to be committed while returning a custom error (

    supabase#1310)
    
    ## What kind of change does this PR introduce?
    * This PR introduces a new error type `CommitWithError` that allows one
    to commit a transaction but also return an error.
    * This is useful in situations where
    `GOTRUE_MAILER_ALLOW_UNVERIFIED_EMAIL_SIGN_INS="false"` since oauth
    users with an unverified email will require email confirmation before
    being allowed to sign-in. If the transaction doesn't get committed, the
    new user doesn't get created and the email confirmation sent out will
    not be mapped to a user in the database.
    kangmingtay authored Nov 16, 2023
    Configuration menu
    Copy the full SHA
    8565d26 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2023

  1. feat: fix refresh token reuse revocation (supabase#1312)

    Refresh token reuse revocation was broken, as an error was returned from
    the transaction where the revocation took place, which rolled back any
    changes. This went unnoticed as the reuse error was sent. Ouch.
    hf authored Nov 20, 2023
    Configuration menu
    Copy the full SHA
    6e313f8 View commit details
    Browse the repository at this point in the history
  2. fix: disable allow unverified email sign ins if autoconfirm enabled (s…

    …upabase#1313)
    
    ## What kind of change does this PR introduce?
    * default `GOTRUE_MAILER_ALLOW_UNVERIFIED_EMAIL_SIGN_INS` to false
    kangmingtay authored Nov 20, 2023
    Configuration menu
    Copy the full SHA
    9b93ac1 View commit details
    Browse the repository at this point in the history
  3. feat: update primary key for identities table (supabase#1311)

    ## What kind of change does this PR introduce?
    * We need to be able to have a consistent identifier to fetch an
    identity from the database. The current approach for using a composite
    primary key isn't sufficient and not ideal for exposing through the API.
    * Remove the composite primary key on (`auth.identities.id`,
    `auth.identities.provider`)
    * Rename `auth.identities.id` to `auth.identities.provider_id`
    * Add a new primary key called `auth.identities.id` 
    * Add a unique constraint on (`auth.identities.provider_id`,
    `auth.identities.provider`)
    
    ---------
    
    Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
    kangmingtay and hf authored Nov 20, 2023
    Configuration menu
    Copy the full SHA
    d8ec801 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2023

  1. feat: add endpoint to unlink identity from user (supabase#1315)

    ## What kind of change does this PR introduce?
    * Adds an endpoint `DELETE /user/identities/{identity_id}` to allow the
    user to unlink an identity
    * User is only allowed to unlink an identity if they have more than 1
    identity linked
    * User must be authenticated to unlink the identity
    
    ```curl
    // successful request
    $ curl -X DELETE 'http://localhost:9999/user/identities/{identity_id}' -H 'Authorization: Bearer <user's JWT>'
    {}
    ```
    
    ---------
    
    Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
    kangmingtay and hf authored Nov 21, 2023
    Configuration menu
    Copy the full SHA
    af83b34 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2023

  1. chore(deps): bump github.com/go-jose/go-jose/v3 from 3.0.0 to 3.0.1 (s…

    …upabase#1316)
    
    Bumps
    [github.com/go-jose/go-jose/v3](https://github.com/go-jose/go-jose) from
    3.0.0 to 3.0.1.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/go-jose/go-jose/releases">github.com/go-jose/go-jose/v3's
    releases</a>.</em></p>
    <blockquote>
    <h2>Version 3.0.1</h2>
    <h3>Fixed</h3>
    <p>Security issue: an attacker specifying a large &quot;p2c&quot; value
    can cause JSONWebEncryption.Decrypt and JSONWebEncryption.DecryptMulti
    to consume large amounts of CPU, causing a DoS. Thanks to Matt Schwager
    (<a href="https://github.com/mschwager"><code>@​mschwager</code></a>)
    for the disclosure and to Tom Tervoort for originally publishing the
    category of attack. <a
    href="https://i.blackhat.com/BH-US-23/Presentations/US-23-Tervoort-Three-New-Attacks-Against-JSON-Web-Tokens.pdf">https://i.blackhat.com/BH-US-23/Presentations/US-23-Tervoort-Three-New-Attacks-Against-JSON-Web-Tokens.pdf</a></p>
    <p>The release is tagged off the release-v3.0.1 branch to avoid mixing
    in some as-yet unreleased changes on the v3 branch.</p>
    </blockquote>
    </details>
    <details>
    <summary>Changelog</summary>
    <p><em>Sourced from <a
    href="https://github.com/go-jose/go-jose/blob/v3/CHANGELOG.md">github.com/go-jose/go-jose/v3's
    changelog</a>.</em></p>
    <blockquote>
    <h1>v3.0.1</h1>
    <p>Fixed:</p>
    <ul>
    <li>Security issue: an attacker specifying a large &quot;p2c&quot; value
    can cause
    JSONWebEncryption.Decrypt and JSONWebEncryption.DecryptMulti to consume
    large
    amounts of CPU, causing a DoS. Thanks to Matt Schwager (<a
    href="https://github.com/mschwager"><code>@​mschwager</code></a>) for
    the
    disclosure and to Tom Tervoort for originally publishing the category of
    attack.
    <a
    href="https://i.blackhat.com/BH-US-23/Presentations/US-23-Tervoort-Three-New-Attacks-Against-JSON-Web-Tokens.pdf">https://i.blackhat.com/BH-US-23/Presentations/US-23-Tervoort-Three-New-Attacks-Against-JSON-Web-Tokens.pdf</a></li>
    </ul>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/go-jose/go-jose/commit/47edce0854d533ac27795c9befd90b1f7ef87554"><code>47edce0</code></a>
    Fix decryption DoS: Reject too high p2c (<a
    href="https://github.com/go-jose/go-jose/issues/66">#66</a>)</li>
    <li>See full diff in <a
    href="https://github.com/go-jose/go-jose/compare/v3.0.0...v3.0.1">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/go-jose/go-jose/v3&package-manager=go_modules&previous-version=3.0.0&new-version=3.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/supabase/gotrue/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Nov 23, 2023
    Configuration menu
    Copy the full SHA
    fd0e543 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2023

  1. refactor: rename GenerateLink to adminGenerateLink (supabase#1320)

    Follows the pattern where all admin handlers are named `adminXYZ`.
    hf authored Nov 27, 2023
    Configuration menu
    Copy the full SHA
    5ea3448 View commit details
    Browse the repository at this point in the history
  2. feat: password sign-up no longer blocks the db connection (supabase#1319

    )
    
    Password sign-up would perform the password hashing while a database
    connection is open, thereby blocking it unnecessarily for tens of
    milliseconds. This can result in behavior where just a few password
    sign-up calls could slow down Auth entirely as the password hashing
    causes pool exhaustion and thus increased latency across all Auth APIs
    not just the password sign-up calls.
    
    The hashing is done inside `models.NewUser()` making it very difficult
    to refactor properly. Therefore, the model object generation is now
    moved as a function of `api.SignupParams.ToUserModel()`. If these params
    contain a password, the code is refactored to move the model generation
    outside of the database transaction.
    hf authored Nov 27, 2023
    Configuration menu
    Copy the full SHA
    84d4b75 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2023

  1. feat: refactor for central password strength check (supabase#1321)

    Refactors all places where the password strength check (right now just
    length check) is enforced to a single method on the API
    `checkPasswordStrength`.
    
    To do this, both `SignupParams` and `UserUpdateParams` had to be
    reworked. Furthermore user update now splits basic validation logic from
    user update validation logic and the main updating transaction which
    should drastically speed up the method itself.
    hf authored Nov 28, 2023
    Configuration menu
    Copy the full SHA
    5524653 View commit details
    Browse the repository at this point in the history
  2. refactor: refactor mfa tests (supabase#1322)

    ## What kind of change does this PR introduce?
    
    The mfa tests are hard to read. There's also a lot of redundant code
    which makes testing for hooks quite a bit harder. This PR aims to remove
    some of the redundancy so that it's easier to write the tests for supabase#1314
    
    Main changes include
    - Splitting out `enrollAndVerify` into `enroll` and `verify` 
    -  Using suite specific constants
    -  Packaging duplicated setup code
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Nov 28, 2023
    Configuration menu
    Copy the full SHA
    0540c7f View commit details
    Browse the repository at this point in the history
  3. feat: add required characters password strength check (supabase#1323)

    Adds the `GOTRUE_PASSWORD_REQUIRED_CHARACTERS` config option, which if
    set, will reject passwords that do not contain at least one character of
    each set of characters.
    
    It is defined like so: `abc...xyz:0123...89`. This means that at least
    one lowercase and one digit has to be present in the password to be
    accepted. All other characters are also allowed. To include the `:`
    character, escape it with `\:`.
    
    When a weak password is detected, the HTTP 429 error is sent with an
    additional JSON field `weak_password` that includes a `reasons` property
    -- an array of the strings:
    
    - `length` if the password is not long enough
    - `characters` if the password does not use all required character sets
    
    ---------
    
    Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
    hf and kangmingtay authored Nov 28, 2023
    Configuration menu
    Copy the full SHA
    3991bdb View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2023

  1. feat: add manual linking APIs (supabase#1317)

    ## What kind of change does this PR introduce?
    * Adds a new endpoint `GET /user/identities/authorize` which is an
    endpoint to initiate the manual linking process and can only be invoked
    if the user is authenticated
    * `GET /user/identities/authorize` functions similarly to `GET
    /authorize` where the user needs to login to the new oauth identity in
    order to link the identity
    * Example
    ```curl
    // sign in with one of the supported auth methods to get the user's access token JWT first
    
    // start the identity linking process
    $ curl -X GET "http://localhost:9999/user/identities/authorize?provider=google" -H "Authorization: Bearer ACCESS_TOKEN_JWT"
    
    {"url":"https://oauth_provider_url.com/path/to/sign-in"}
    
    // visit the url returned and login to the oauth provider 
    // request will be redirected to the /callback endpoint
    
    // if the identity is successfully linked, the request will be redirected to `http://localhost:3000/#access_token=xxx&....`
    
    // if the identity already exists, the request will be redirect to:
    // http://localhost:3000/?error=invalid_request&error_code=400&error_description=Identity+is+already+linked+to+another+user#error=invalid_request&error_code=400&error_description=Identity+is+already+linked+to+another+user
    ```
    
    ## Details
    * The callback endpoint used will be the same callback as the oauth
    sign-in flow so that the developer doesn't have to add any additional
    callback URLs to the oauth provider in order to enable manual linking
    * A special field `LinkingTargetId` is introduced in the oauth state to
    store the linking target user ID. This ID will be used in the callback
    to determine the target user to link the candidate identity used
    * If the identity is already linked to the current user or another user,
    an error will be returned
    * If the identity doesn't exist, then it will be successfully linked to
    the existing user and a new access & refresh token will be issued.
    
    ---------
    
    Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
    kangmingtay and hf authored Nov 29, 2023
    Configuration menu
    Copy the full SHA
    80172a1 View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2023

  1. feat: add haveibeenpwned.org password strength check (supabase#1324)

    Uses Supabase's HIBP Go library to perform password strength checks
    using the HaveIBeenPwned.org Pwned Passwords API.
    
    You can configure this behavior by:
    
    - `GOTRUE_PASSWORD_HIBP_ENABLED` to turn it on
    - `GOTRUE_PASSWORD_HIBP_USER_AGENT` to specify your project's identifier
    - `GOTRUE_PASSWORD_HIBP_FAIL_CLOSED` if the API is unavailable (or
    unresponsive for 5 seconds) the response is ignored and any password is
    accepted, set this to true to fail with a 500 error in such cases
    - `GOTRUE_PASSWORD_HIBP_BLOOM_ENABLED` to enable a bloom filter cache
    - `GOTRUE_PASSWORD_HIBP_BLOOM_ITEMS` to specify the maximum number of
    pwned password hashes to be stored in the bloom filter
    - `GOTRUE_PASSWORD_HIBP_BLOOM_FALSE_POSITIVES` to specify the maximum
    number of false positives returned by the bloom filter, a value between
    0 and 1 indicating _1 in X_
    
    For bloom filters, use this calculator to understand the values:
    https://hur.st/bloomfilter
    
    By default 100,000 password hashes can be stored in the filter (about
    100 hash prefixes). The filter resets at 80% of this value to ensure
    that the cache is cleared and the actual false positive rate does not go
    too high.
    hf authored Nov 30, 2023
    Configuration menu
    Copy the full SHA
    c3acfe7 View commit details
    Browse the repository at this point in the history
  2. feat: add mfa verification postgres hook (supabase#1314)

    ## What kind of change does this PR introduce?
    
    Proof of concept hook for MFA Verification. With this hook, developers
    can introduce additional conditions around when to accept/reject an MFA
    verification (e.g. log a developer out after a certain number of
    attempts).
    
    We distinguish this from the existing Webhooks implementation via
    introduction of `hooks` package which will contain future Hook related
    structs, constants, and utility methods.
    
    For the most part we leverage existing Postgres capabilities - as far as
    possible we will return the PostgreSQL error codes for debugging and use
    Postgres in-built timeouts to ensure hte hook doesn't overrun.
    
    ## Testing
    
    The MFA Verification Hook test suite does not guarantee accurate status
    codes - the test setup (to enroll factors and create a challenge after
    signup) requires some setup. It is reliant on `signUpAndVerify` which
    gets the dev to AAL2 and takes time to refactor.
    
    As such, most of the cases were manually tested in addition to the
    current loose check of checking for the absence of an access token.
    Further edits will be made in GMT +8 morning to properly check for the
    http status codes in the tests.
    
    Also, since `supabase_auth_admin` cannot create functions on the
    `public` schema we create the functions on the `auth` schema for
    testing. We typically discourage this on the Supabase platform but in
    theory there should be no issue when dealing with GoTrue (the OSS
    project). Will spend a short amount of time looking into alternatives
    tomorrow.
    
    
    ## Additional Notes
    
    Response schema checks are left out of this PR as they don't seem to
    serve as much benefit for this particular extensibility point and will
    probably bloat the PR a little with the introduction of a new library
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
    3 people authored Nov 30, 2023
    Configuration menu
    Copy the full SHA
    db344d5 View commit details
    Browse the repository at this point in the history
  3. feat: unlinking primary identity should update email (supabase#1326)

    ## What kind of change does this PR introduce?
    * A primary identity is implicitly defined by the first identity created
    when the user signs up
    * Addresses the issue where unlinking a primary identity results in the
    `auth.users.email` becoming stale. If the other identities do not have
    the same email, the `auth.users.email` column should be updated to use
    one of the existing identities emails
    * Update the `FindProvidersByUser` method to remove duplicates if there
    is more than 1 identity that share the same provider
    kangmingtay authored Nov 30, 2023
    Configuration menu
    Copy the full SHA
    bdc3300 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    379b066 View commit details
    Browse the repository at this point in the history

Commits on Dec 1, 2023

  1. feat: refactor hook error handling (supabase#1329)

    Refactors the error handling of hooks so the proper errors bubble up.
    hf authored Dec 1, 2023
    Configuration menu
    Copy the full SHA
    72fdb16 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. fix: update suggested Go version for contributors to 1.21 (supabase#1331

    )
    
    Update suggested Go version for contributors from `1.16` to `1.21`.
    JKFSOM authored Dec 4, 2023
    Configuration menu
    Copy the full SHA
    9feeec4 View commit details
    Browse the repository at this point in the history
  2. Add password verification hook (supabase#1328)

    ## What kind of change does this PR introduce?
    
    Similar to the MFA Verification Hook, this hook should allow for
    developers to customize the behaviour of Supabase after a failed
    password verification attempt.
    
    Example use cases include: 
    - blocking a user after multiple failed attempts.
    - Imposing additional restrictions  on top of password verification.
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
    3 people authored Dec 4, 2023
    Configuration menu
    Copy the full SHA
    4f50112 View commit details
    Browse the repository at this point in the history
  3. refactor: reduce amount of test setup code in mfa tests (supabase#1333)

    ## What kind of change does this PR introduce?
    
    Primary goal of this refactor is to reduce number of calls to
    `generateAccessToken` to ease refactoring of `generateAccessToken`. This
    PR centralizes a few commonly used functions/objects:
    
    - `generateAccessToken`
    - `models.User`
    - It also directly accesses `models.Factors` on `ts.TestUser` instead of
    fetching it from the DB via `models.FindFactorsByUserID`
    
    Tests with multiple cases were left untouched as they have interleaving
    interactions in some cases
    
    ---------
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Dec 4, 2023
    Configuration menu
    Copy the full SHA
    d405ffd View commit details
    Browse the repository at this point in the history
  4. refactor: centralize generateAccessToken for user tests (supabase#1334)

    ## What kind of change does this PR introduce?
    
    Similar to supabase#1333 we centralize the setup around `generateAccessToken`
    
    Co-authored-by: joel@joellee.org <joel@joellee.org>
    J0 and joel@joellee.org authored Dec 4, 2023
    Configuration menu
    Copy the full SHA
    4254873 View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2023

  1. Configuration menu
    Copy the full SHA
    c4665e4 View commit details
    Browse the repository at this point in the history
  2. remove namespace

    velddev committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    0d96c9d View commit details
    Browse the repository at this point in the history