-
Notifications
You must be signed in to change notification settings - Fork 444
fix: enforce email confirmation requirement for sign-ins with unverified emails #1982
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
Open
flik930
wants to merge
946
commits into
supabase:main
Choose a base branch
from
flik930:master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
946 commits
Select commit
Hold shift + click to select a range
e4f2b59
feat: refactor generate accesss token to take in request (#1531)
J0 4f5e8e5
fix: linkedin_oidc provider error (#1534)
omerhochman 58ef4af
fix: revert patch for linkedin_oidc provider error (#1535)
J0 10d6d8b
fix: update linkedin issuer url (#1536)
kangmingtay dd4f0e0
chore(master): release 2.149.0 (#1532)
github-actions[bot] 348a1da
feat: allow for postgres and http functions on each extensibility poi…
J0 91e9eca
fix: return error if session id does not exist (#1538)
kangmingtay d4d743c
feat: send over user in SendSMS Hook instead of UserID (#1551)
J0 9594a53
chore(deps): bump golang.org/x/net from 0.21.0 to 0.23.0 (#1545)
dependabot[bot] 1cb4f96
feat: add support for Azure CIAM login (#1541)
hf bd8b5c4
feat: merge provider metadata on link account (#1552)
hf f96ff31
feat: add timeout middleware (#1529)
J0 5bedafc
chore(master): release 2.150.0 (#1537)
github-actions[bot] 2caa7b4
fix: add db conn max idle time setting (#1555)
hf 6ec08b3
ci: add exhaustive switch statement linter (#1557)
hf 374a9c2
chore(master): release 2.150.1 (#1556)
github-actions[bot] 170bd66
fix: log final writer error instead of handling (#1564)
hf 434a59a
fix: format test otps (#1567)
kangmingtay bfe4d98
fix: do call send sms hook when SMS autoconfirm is enabled (#1562)
J0 d1cf8d9
feat: refactor one-time tokens for performance (#1558)
hf 68e31d9
chore(master): release 2.151.0 (#1565)
github-actions[bot] 86a79df
feat: update openapi spec with identity and is_anonymous fields (#1573)
J0 ed2b490
fix: use api_external_url domain as localname (#1575)
kangmingtay e5f98cb
fix: sms verify should update is_anonymous field (#1580)
kangmingtay c22fc15
fix: improve logging structure (#1583)
kangmingtay c64ae3d
feat: update chi version (#1581)
kangmingtay 39ca026
feat: remove legacy lookup in users for one_time_tokens (phase II) (#…
hf 72614a1
feat: new timeout writer implementation (#1584)
hf b954a48
chore(master): release 2.152.0 (#1574)
github-actions[bot] 93f52fc
chore: remove unused args in functions (#1594)
kangmingtay 6c9fbd4
fix: deadlock issue with timeout middleware write (#1595)
kangmingtay 0ef7eb3
fix: call write header in write if not written (#1598)
hf b352719
feat: add SAML specific external URL config (#1599)
hf 55409f7
feat: add support for verifying argon2i and argon2id passwords (#1597)
hf 5262683
fix: improve token OIDC logging (#1606)
kangmingtay 53e223a
feat: make the email client explicity set the format to be HTML (#1149)
mansueli e3ebffb
chore: bump alpine and go versions (#1607)
kangmingtay cbcab16
ci: upgrade local dockerfile go version (#1608)
hf 5894d9e
fix: update contributing to use v1.22 (#1609)
J0 dd16b95
chore(master): release 2.153.0 (#1596)
github-actions[bot] 4f9994b
feat: use largest avatar from spotify instead (#1210)
william-matz f9c13c0
feat: add max length check for email (#1508)
LashaJini fa90764
ci: re-format files (#1611)
hf cdd13ad
feat: upgrade otel to v1.26 (#1585)
J0 357bda2
fix: define search path in auth functions (#1616)
kangmingtay e4a4758
feat: encrypt sensitive columns (#1593)
hf cd7b191
ci: fix doubling of rc version identifier (#1618)
J0 bb99251
feat: add support for Slack OAuth V2 (#1591)
zhawtof 28967aa
fix: enable rls & update grants for auth tables (#1617)
kangmingtay 3cd00ee
chore(master): release 2.154.0 (#1610)
github-actions[bot] f5c6fcd
fix: admin user update should update is_anonymous field (#1623)
kangmingtay 06464c0
fix: add ip based limiter (#1622)
kangmingtay bca0ea7
chore(master): release 2.154.1 (#1624)
github-actions[bot] 930aa3e
fix: publish to ghcr.io/supabase/auth (#1626)
J0 e81c25d
fix: update MaxFrequency error message to reflect number of seconds (…
J0 155e87e
fix: revert define search path in auth functions (#1634)
J0 32afa7e
chore(master): release 2.154.2 (#1628)
github-actions[bot] d8b47f9
fix: improve mfa verify logs (#1635)
kangmingtay bbecbd6
fix: use pointer for `user.EncryptedPassword` (#1637)
hf 2cb97f0
fix: upgrade golang-jwt to v5 (#1639)
kangmingtay 97b8f1b
fix: return proper error message when invalid email_change token is …
J0 3f70d9d
fix: invited users should have a temporary password generated (#1644)
kangmingtay 20d59f1
feat: add `password_hash` and `id` fields to admin create user (#1641)
kangmingtay 85361b7
chore(master): release 2.155.0 (#1640)
github-actions[bot] 3c8d765
fix: return proper error if sms rate limit is exceeded (#1647)
kangmingtay 42c1d45
fix: check for empty aud string (#1649)
kangmingtay a518505
fix: apply mailer autoconfirm config to update user email (#1646)
kangmingtay 9c88ee5
chore(master): release 2.155.1 (#1648)
github-actions[bot] 33caaa9
chore(deps): bump github.com/rs/cors from 1.9.0 to 1.11.0 (#1650)
dependabot[bot] 10ca9c8
fix: set rate limit log level to warn (#1652)
kangmingtay 4e6ef47
chore: add default tests for saml assertions (#1651)
kangmingtay bf5381a
fix: omit empty string from name & use case-insensitive equality for …
kangmingtay 5a6793e
fix: improve session error logging (#1655)
kangmingtay ac61939
chore(master): release 2.155.2 (#1653)
github-actions[bot] 98d8324
fix: serialize jwt as string (#1657)
kangmingtay 9ac3cff
chore(master): release 2.155.3 (#1658)
github-actions[bot] f99286e
fix: treat empty string as nil in `encrypted_password` (#1663)
hf 04752de
chore(master): release 2.155.4 (#1664)
github-actions[bot] 1858c93
fix: check password max length in checkPasswordStrength (#1659)
kangmingtay 7e67f3e
fix: don't update attribute mapping if nil (#1665)
kangmingtay 822fb93
fix: refactor mfa models and add observability to loadFactor (#1669)
J0 ad7a770
chore(master): release 2.155.5 (#1666)
github-actions[bot] 8efd57d
fix: use deep equal (#1672)
kangmingtay 25d1447
chore(master): release 2.155.6 (#1673)
github-actions[bot] b57e223
fix: restrict autoconfirm email change to anonymous users (#1679)
kangmingtay f9df65c
feat: add is_anonymous claim to Auth hook jsonschema (#1667)
J0 f0a40c5
chore(master): release 2.156.0 (#1680)
github-actions[bot] c7a2be3
feat: add asymmetric jwt support (#1674)
kangmingtay 7de0cb3
chore(master): release 2.157.0 (#1683)
github-actions[bot] 46491b8
feat: add hook log entry with `run_hook` action (#1684)
hf ae091aa
feat: MFA (Phone) (#1668)
J0 0ad1402
fix: maintain backward compatibility for asymmetric JWTs (#1690)
kangmingtay 6aca52b
fix: minor spelling errors (#1688)
J0 3d448fa
fix: MFA NewFactor to default to creating unverfied factors (#1692)
J0 fdff1e7
fix: update mfa phone migration to be idempotent (#1687)
J0 8015251
fix: treat `GOTRUE_MFA_ENABLED` as meaning TOTP enabled on enroll and…
hf 4aef63f
chore(master): release 2.158.0 (#1686)
github-actions[bot] a3da4b8
fix: update openapi spec for MFA (Phone) (#1689)
J0 6ccd814
fix: expose `X-Supabase-Api-Version` header in CORS (#1612)
hf 250d92f
fix: refactor TOTP MFA into separate methods (#1698)
J0 81b332d
fix: remove check for content-length (#1700)
kangmingtay ac14e82
fix: include factor_id in query (#1702)
kangmingtay 701a779
fix: move is owned by check to load factor (#1703)
J0 575e88a
fix: allow enabling sms hook without setting up sms provider (#1704)
kangmingtay 078c3a8
fix: drop the MFA_ENABLED config (#1701)
J0 af8e2dd
fix: remove FindFactorsByUser (#1707)
J0 70446cc
fix: enforce uniqueness on verified phone numbers (#1693)
J0 29cbeb7
fix: add last_challenged_at field to mfa factors (#1705)
J0 e1a21a3
fix: expose factor type on challenge (#1709)
J0 499f6fc
chore(master): release 2.158.1 (#1699)
github-actions[bot] 92409ea
chore: remove unused hook outputs (#1712)
kangmingtay b9bc769
fix: change phone constraint to per user (#1713)
J0 4b04327
fix: remove TOTP field for phone enroll response (#1717)
J0 4351226
fix: add error codes to password login flow (#1721)
kangmingtay b2b1123
fix: redirect invalid state errors to site url (#1722)
kangmingtay 0658bbe
chore: updated regex for provider name (#1723)
hiteshbedre 53c11d1
fix: ignore errors if transaction has closed already (#1726)
kangmingtay a9ff361
feat: Vercel marketplace OIDC (#1731)
MildTomato dc2391d
fix: custom SMS does not work with Twilio Verify (#1733)
hf 66fd0c8
fix: use signing jwk to sign oauth state (#1728)
kangmingtay a6de8c9
chore(master): release 2.159.0 (#1716)
github-actions[bot] 60cfb60
fix: return oauth identity when user is created (#1736)
kangmingtay 10fa347
chore(master): release 2.159.1 (#1737)
github-actions[bot] 2d51956
fix: allow anonymous user to update password (#1739)
kangmingtay c6efec4
fix: remove server side cookie token methods (#1742)
J0 7e38f4c
fix: hide hook name (#1743)
J0 d03a54e
chore(master): release 2.159.2 (#1741)
github-actions[bot] bf276ab
fix: apply shared limiters before email / sms is sent (#1748)
kangmingtay c5480ef
feat: add support for saml encrypted assertions (#1752)
hf 2ad0737
feat: add option to disable magic links (#1756)
hf f3a28d1
feat: add authorized email address support (#1757)
hf 0084625
fix: simplify WaitForCleanup (#1747)
LashaJini 7009202
chore(master): release 2.160.0 (#1749)
github-actions[bot] 9d419b4
fix: user sanitization should clean up email change info too (#1759)
staaldraad a6c1824
chore: fix gosec warnings via ignore annotations in comments (#1770)
cstockton 7e472ad
fix: add token to hook payload for non-secure email change (#1763)
J0 567ea7e
fix: update mfa admin methods (#1774)
J0 77d5897
feat: add webauthn configuration variables (#1773)
J0 25d9874
fix: update aal requirements to update user (#1766)
J0 c2b2f96
fix: add additional information around errors for missing content typ…
J0 6ee0091
feat: config reloading (#1771)
cstockton ed91c59
feat: add `x-sb-error-code` header, show error code in logs (#1765)
hf 5b03fda
chore(master): release 2.161.0 (#1760)
github-actions[bot] 7a5411f
fix: magiclink failing due to passwordStrength check (#1769)
klajdi369 ba00f75
feat: add support for migration of firebase scrypt passwords (#1768)
J0 1af203f
fix: apply authorized email restriction to non-admin routes (#1778)
kangmingtay 2c13a7f
chore(master): release 2.162.0 (#1777)
github-actions[bot] 9ac2ea0
fix: bypass check for token & verify endpoints (#1785)
kangmingtay 85d400a
chore(master): release 2.162.1 (#1786)
github-actions[bot] 97a48f6
fix: upgrade ci Go version (#1782)
J0 819dabb
ci: update openapi spec for saml and generate_link (#1783)
J0 410b8ac
fix: refactor mfa validation into functions (#1780)
J0 2e9b144
fix: validateEmail should normalise emails (#1790)
kangmingtay 56e3d33
chore(master): release 2.162.2 (#1787)
github-actions[bot] aeb5d8f
fix: add twilio verify support on mfa (#1714)
J0 7f006b6
fix: fix `getExcludedColumns` slice allocation (#1788)
cuishuang 0a3968b
feat: preserve rate limiters in memory across configuration reloads (…
cstockton 646dc66
fix: Fix reqPath for bypass check for verify EP (#1789)
angelolamonaca 8cc2f0e
feat: add MFA for WebAuthn (#1775)
J0 5e94047
feat: configurable email and sms rate limiting (#1800)
cstockton fa6f729
fix: inline mailme package for easy development (#1803)
hf 3af03be
fix: email header setting no longer misleading (#1802)
hf 99d6a13
feat: add mail header support via `GOTRUE_SMTP_HEADERS` with `$messag…
hf 9354b83
feat: mailer logging (#1805)
cstockton c0c5b23
fix: enforce authorized address checks on send email only (#1806)
hf 14b375f
chore(master): release 2.163.0 (#1794)
github-actions[bot] 4f6a461
fix: external host validation (#1808)
hf 39459c1
chore(master): release 2.163.1 (#1809)
github-actions[bot] 9ce2340
fix: ignore rate limits for autoconfirm (#1810)
kangmingtay 6ac5624
chore(master): release 2.163.2 (#1811)
github-actions[bot] 26d2e36
feat: return validation failed error if captcha request was not json …
hf 158e473
fix: make drop_uniqueness_constraint_on_phone idempotent (#1817)
kangmingtay 3b03472
chore: use retrieveRequestParams where possible (#1818)
kangmingtay fa020d0
fix: improve error messaging for http hooks (#1821)
kangmingtay a7129df
fix: possible panic if refresh token has a null session_id (#1822)
kangmingtay 4614dc5
fix: add error codes to refresh token flow (#1824)
kangmingtay 635d9ba
chore(deps): bump github.com/golang-jwt/jwt/v4 from 4.4.3 to 4.5.1 (#…
dependabot[bot] 0a589d0
fix: correct web authn aaguid column naming (#1826)
J0 7c3cf26
fix: add test coverage for rate limits with 0 permitted events (#1834)
cstockton 9ce2857
fix: default to files:read scope for Figma provider (#1831)
smogg cb7894e
fix: rate limits of 0 take precedence over MAILER_AUTO_CONFIRM (#1837)
cstockton a616451
chore(master): release 2.164.0 (#1816)
github-actions[bot] 7de6bfb
ci: upload release artifact to supabase s3 bucket (#1812)
hf e358da5
feat: use embedded migrations for `migrate` command (#1843)
hf 49fbbf0
fix: update ip mismatch error message (#1849)
J0 1bad34e
Revert "ci: upload release artifact to supabase s3 bucket" (#1854)
kangmingtay 834a380
fix: return the error code instead of status code (#1855)
kangmingtay b33bc31
fix: fallback on btree indexes when hash is unavailable (#1856)
olirice 307d6ee
chore: update check conventional-commits (#1857)
staaldraad 1c7202f
fix: revert fallback on btree indexes when hash is unavailable (#1858)
J0 2c291f0
feat: add email validation function to lower bounce rates (#1845)
cstockton a19d62d
chore(master): release 2.165.0 (#1846)
github-actions[bot] 9fe5b1e
fix: Revert "fix: revert fallback on btree indexes when hash is unava…
olirice 40e0de1
chore(deps): bump golang.org/x/crypto from 0.26.0 to 0.31.0 (#1869)
dependabot[bot] 483463e
fix: email_verified field not being updated on signup confirmation (#…
kangmingtay a6918f4
fix: handle user banned error code (#1851)
J0 fd82601
fix: check if session is nil (#1873)
kangmingtay a3eecd1
chore: merge release/2.165.0 into master (#1875)
cstockton f572ced
fix: skip cleanup for non-2xx status (#1877)
kangmingtay 11a312f
feat: switch to googleapis/release-please-action, bump to 2.166.0 (#1…
hf 6de1e19
chore(master): release 2.166.0 (#1884)
github-actions[bot] 9dbe6ef
feat: fix argon2 parsing and comparison (#1887)
hf 9c97b8e
chore(master): release 2.167.0 (#1888)
github-actions[bot] 7b83c4b
docs: change coveralls image in README (#1889)
hf 4faea5a
ci: fix coverage metering by removing files not under test (#1890)
hf a7f1c6e
ci: use `alpine:3` as base image (#1894)
hf a3cbe6a
docs: update README for command syntax and binary execution (#1897)
12138zhen 871195f
docs: update CONTRIBUTING.md for macOS installation instructions (#1893)
12138zhen 307892f
feat: set `email_verified` to true on all identities with the verifie…
hf 0611897
ci: fix unspecified version at runtime in docker images (#1903)
hf 28b715b
chore(master): release 2.168.0 (#1904)
github-actions[bot] 5c1deb2
docs: update OpenAPI schema to use 'minimum' instead of 'min' for int…
12138zhen 0cfd177
docs: correct casing of API key authentication in OpenAPI (#1896)
12138zhen 174198e
feat: cover 100% of crypto with tests (#1892)
hf 52141c6
ci: introduce dogfooding check on release (#1909)
hf 6811fc8
ci: fix dogfooding check (#1910)
hf 05c8c09
ci: fix dogfooding check to identify current latest rc not future rc …
hf daa7e37
docs: update `api.go` reference (#1912)
emmanuel-ferdman 586df26
docs: update README to correct code snippets and add resend OTP endpo…
12138zhen f72f0ee
fix: improve invalid channel error message returned (#1908)
kangmingtay a4c692f
fix: convert refreshed_at to UTC before updating (#1916)
kangmingtay d6030cc
fix: improve saml assertion logging (#1915)
kangmingtay 37e2349
chore: fix typo in contributing docs (#1923)
thuvh 50eb69b
chore: alias to docker compose command (#1921)
thuvh 1f06f58
feat: add an optional burstable rate limiter (#1924)
cstockton 338a14c
chore(master): release 2.169.0 (#1907)
github-actions[bot] fbbebcc
fix: ignore not found error to check for pkce prefix later (#1929)
kangmingtay 21c2256
feat: improvements to config reloader, 100% coverage (#1933)
cstockton 8078cdc
fix: log version & migration count (#1934)
kangmingtay e137365
docs: update README to use better syntax for `json` code block (#1935)
burmecia bc57c1c
feat: increase test coverage in conf package to 100% (#1937)
cstockton a474b80
fix: enable SO_REUSEPORT in listener config (#1936)
kangmingtay 5399ffc
chore: upgrade oapi-codegen (#1930)
kangmingtay 8a26f4b
chore(deps): bump github.com/go-jose/go-jose/v3 from 3.0.3 to 3.0.4 (…
dependabot[bot] 18fbbb5
fix: update figma token endpoint (#1952)
kangmingtay 4a6d9bc
fix: use sys/unix instead of syscall (#1953)
kangmingtay 225d2b6
chore: use go 1.23.7 (#1956)
kangmingtay 779f18d
chore(master): release 2.170.0 (#1931)
github-actions[bot] 608be00
chore(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.1 to 4.5.2 (#…
dependabot[bot] a839d24
chore(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2 (#…
dependabot[bot] 5eec914
chore(deps): bump golang.org/x/net from 0.25.0 to 0.36.0 (#1960)
dependabot[bot] 6b842f6
feat: allow invalid config directories (#1969)
cstockton e408905
chore: move error codes to `apierrors` package (#1973)
cstockton e882b42
fix: propagate error when when confirming phone (#1939)
cstockton d121546
feat: add sign in with solana (EIP-4361) support (#1918)
Bewinxed ccf20d7
fix: sanitize redirect URL (remove fragment, query) before pattern ma…
doublethink 091aef9
feat: Block specific outgoing mail servers (#1971)
doublethink 06e9ead
fix: explicit permisions on actions (#1978)
doublethink 696f5dc
fix: enforce email confirmation requirement for sign-ins with unverif…
flik930 5d74291
feat: add phone confirmation timestamp to user model
flik930 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Set the default behavior | ||
* text=auto | ||
|
||
# Go files | ||
*.mod text eol=lf | ||
*.sum text eol=lf | ||
*.go text eol=lf | ||
|
||
# Serialization | ||
*.yml eol=lf | ||
*.yaml eol=lf | ||
*.toml eol=lf | ||
*.json eol=lf | ||
|
||
# Scripts | ||
*.sh eol=lf | ||
|
||
# DB files | ||
*.sql eol=lf | ||
|
||
# Html | ||
*.html eol=lf | ||
|
||
# Text and markdown files | ||
*.txt text eol=lf | ||
*.md text eol=lf | ||
|
||
# Environment files/examples | ||
*.env text eol=lf | ||
|
||
# Docker files | ||
.dockerignore text eol=lf | ||
Dockerfile* text eol=lf | ||
|
||
# Makefile | ||
Makefile text eol=lf | ||
|
||
# Git files | ||
.gitignore text eol=lf | ||
.gitattributes text eol=lf | ||
.gitkeep text eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* @netlify/opensource @netlify/backend | ||
* @supabase/auth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
"use strict"; | ||
|
||
const fs = require("fs"); | ||
|
||
const TITLE_PATTERN = | ||
/^(?<prefix>[^:!(]+)(?<package>\([^)]+\))?(?<breaking>[!])?:.+$/; | ||
const RELEASE_AS_DIRECTIVE = /^\s*Release-As:/im; | ||
const BREAKING_CHANGE_DIRECTIVE = /^\s*BREAKING[ \t]+CHANGE:/im; | ||
|
||
const ALLOWED_CONVENTIONAL_COMMIT_PREFIXES = [ | ||
"revert", | ||
"feat", | ||
"fix", | ||
"ci", | ||
"docs", | ||
"chore", | ||
]; | ||
|
||
const object = process.argv[2]; | ||
const payload = JSON.parse(fs.readFileSync(process.argv[3], "utf-8")); | ||
|
||
let validate = []; | ||
|
||
if (object === "pr") { | ||
validate.push({ | ||
title: payload.pull_request.title, | ||
content: payload.pull_request.body, | ||
}); | ||
} else if (object === "push") { | ||
validate.push( | ||
...payload.commits | ||
.map((commit) => ({ | ||
title: commit.message.split("\n")[0], | ||
content: commit.message, | ||
})) | ||
.filter(({ title }) => !title.startsWith("Merge branch ") && !title.startsWith("Revert ")), | ||
); | ||
} else { | ||
console.error( | ||
`Unknown object for first argument "${object}", use 'pr' or 'push'.`, | ||
); | ||
process.exit(0); | ||
} | ||
|
||
let failed = false; | ||
|
||
validate.forEach((payload) => { | ||
if (payload.title) { | ||
const match = payload.title.match(TITLE_PATTERN); | ||
if (!match) { | ||
return | ||
} | ||
|
||
const { groups } = match | ||
|
||
if (groups) { | ||
if (groups.breaking) { | ||
console.error( | ||
`PRs are not allowed to declare breaking changes at this stage of the project. Please remove the ! in your PR title or commit message and adjust the functionality to be backward compatible.`, | ||
); | ||
failed = true; | ||
} | ||
|
||
if ( | ||
!ALLOWED_CONVENTIONAL_COMMIT_PREFIXES.find( | ||
(prefix) => prefix === groups.prefix, | ||
) | ||
) { | ||
console.error( | ||
`PR (or a commit in it) is using a disallowed conventional commit prefix ("${groups.prefix}"). Only ${ALLOWED_CONVENTIONAL_COMMIT_PREFIXES.join(", ")} are allowed. Make sure the prefix is lowercase!`, | ||
); | ||
failed = true; | ||
} | ||
|
||
if (groups.package && groups.prefix !== "chore") { | ||
console.warn( | ||
"Avoid using package specifications in PR titles or commits except for the `chore` prefix.", | ||
); | ||
} | ||
} else { | ||
console.error( | ||
"PR or commit title must match conventional commit structure.", | ||
); | ||
failed = true; | ||
} | ||
} | ||
|
||
if (payload.content) { | ||
if (payload.content.match(RELEASE_AS_DIRECTIVE)) { | ||
console.error( | ||
"PR descriptions or commit messages must not contain Release-As conventional commit directives.", | ||
); | ||
failed = true; | ||
} | ||
|
||
if (payload.content.match(BREAKING_CHANGE_DIRECTIVE)) { | ||
console.error( | ||
"PR descriptions or commit messages must not contain a BREAKING CHANGE conventional commit directive. Please adjust the functionality to be backward compatible.", | ||
); | ||
failed = true; | ||
} | ||
} | ||
}); | ||
|
||
if (failed) { | ||
process.exit(1); | ||
} | ||
|
||
process.exit(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Check pull requests | ||
|
||
on: | ||
push: | ||
branches-ignore: # Run the checks on all branches but the protected ones | ||
- master | ||
- release/* | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
- release/* | ||
types: | ||
- opened | ||
- edited | ||
- reopened | ||
- ready_for_review | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-conventional-commits: | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'dependabot[bot]' # skip for dependabot PRs | ||
env: | ||
EVENT: ${{ toJSON(github.event) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
.github | ||
|
||
- if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
set -ex | ||
|
||
TMP_FILE=$(mktemp) | ||
echo "${EVENT}" > "$TMP_FILE" | ||
node .github/workflows/conventional-commits-lint.js pr "${TMP_FILE}" | ||
|
||
- if: ${{ github.event_name == 'push' }} | ||
run: | | ||
set -ex | ||
|
||
TMP_FILE=$(mktemp) | ||
echo "${EVENT}" > "$TMP_FILE" | ||
node .github/workflows/conventional-commits-lint.js push "${TMP_FILE}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Dogfooding Check | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted, edited] | ||
|
||
pull_request: | ||
types: | ||
- opened | ||
branches: | ||
- '*' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check_dogfooding: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
if: github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.ref == 'release-please--branches--master' | ||
with: | ||
ref: master # used to identify the latest RC version via git describe --tags --match rc* | ||
fetch-depth: 0 | ||
|
||
- if: github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.ref == 'release-please--branches--master' | ||
run: | | ||
set -ex | ||
|
||
# finds the latest RC version on master | ||
RELEASE_VERSION=$(node -e "const a = '$(git describe --tags --match rc*)'.replace(/^rc/, 'v').split('-'); console.log(a[0] + '-' + a[1]);") | ||
|
||
PROD_VERSION=$(curl 'https://auth.supabase.io/auth/v1/health' | jq -r .version) | ||
STAGING_VERSION=$(curl 'https://alt.supabase.green/auth/v1/health' | jq -r .version) | ||
|
||
echo "Expecting RC version $RELEASE_VERSION to be up on prod and staging." | ||
|
||
if [ "$PROD_VERSION" != "$STAGING_VERSION" ] | ||
then | ||
echo "Versions on prod and staging don't match!" | ||
|
||
exit 1 | ||
fi | ||
|
||
if [ "$PROD_VERSION" != "$RELEASE_VERSION" ] | ||
then | ||
echo "Version on prod $PROD_VERSION is not the latest release candidate. Please release this RC first to proof the release before merging this PR." | ||
exit 1 | ||
fi | ||
|
||
echo "Release away!" | ||
exit 0 | ||
|
||
- if: github.event.pull_request.base.ref != 'master' || github.event.pull_request.head.ref != 'release-please--branches--master' | ||
run: | | ||
set -ex | ||
|
||
echo "This PR is not subject to dogfooding checks." | ||
exit 0 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Publish to Image Registry | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
supabase/gotrue | ||
public.ecr.aws/supabase/gotrue | ||
ghcr.io/supabase/gotrue | ||
ghcr.io/supabase/auth | ||
436098097459.dkr.ecr.us-east-1.amazonaws.com/gotrue | ||
646182064048.dkr.ecr.us-east-1.amazonaws.com/gotrue | ||
supabase/auth | ||
public.ecr.aws/supabase/auth | ||
436098097459.dkr.ecr.us-east-1.amazonaws.com/auth | ||
646182064048.dkr.ecr.us-east-1.amazonaws.com/auth | ||
flavor: | | ||
latest=false | ||
tags: | | ||
type=raw,value=v${{ inputs.version }},enable=true | ||
|
||
- uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: amd64,arm64 | ||
|
||
- run: | | ||
set -ex | ||
|
||
echo "Adding explicit release version to Dockerfile..." | ||
|
||
sed -i 's/RELEASE_VERSION=unspecified/RELEASE_VERSION=${{ inputs.version }}/' Dockerfile | ||
|
||
- uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: configure aws credentials - prod | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: ${{ secrets.PROD_AWS_ROLE }} | ||
aws-region: us-east-1 | ||
- name: Login to ECR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: public.ecr.aws | ||
- name: Login to ECR account - prod | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: 646182064048.dkr.ecr.us-east-1.amazonaws.com | ||
|
||
- name: configure aws credentials - staging | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: ${{ secrets.DEV_AWS_ROLE }} | ||
aws-region: us-east-1 | ||
- name: Login to ECR account - staging | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: 436098097459.dkr.ecr.us-east-1.amazonaws.com | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: docker/build-push-action@v3 | ||
with: | ||
context: . # IMPORTANT: Dockerfile is modified above to include the release version. Don't remove this line: https://github.com/docker/build-push-action?tab=readme-ov-file#git-context | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsanitized input from
a command line argument
flows intofs.readFileSync
, where it is used as a path. This may result in a Path Traversal vulnerability and allow an attacker to read arbitrary files.Line 20 | CWE-23 | Priority score 512 | Learn more about this vulnerability
Data flow: 5 steps
Step 1 - 5
auth/.github/workflows/conventional-commits-lint.js
Line 20 in 696f5dc