diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..4e65eaaaa0 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +default: build + +prune: + @docker volume prune + +down: + @docker compose down -v +up: + @docker compose up --build -d + +build: down up + +logs: + @docker compose logs appwrite + +dblogs: + @docker compose logs appwrite-worker-databases + +test: + @docker compose exec appwrite test + +dbtest: + @docker compose exec appwrite test /usr/src/code/tests/e2e/Services/Databases/DatabasesCustomClientTest.php + +testall: + @docker compose exec appwrite test diff --git a/app/console b/app/console index 5e2a40c1e3..de73c020a7 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 5e2a40c1e397bd341a432698c9d76a3f96315841 +Subproject commit de73c020a7798e580c48197816124ca4783e115b diff --git a/src/Appwrite/Auth/OAuth2/Etsy.php b/src/Appwrite/Auth/OAuth2/Etsy.php index 7ff16fcb78..915df8128e 100644 --- a/src/Appwrite/Auth/OAuth2/Etsy.php +++ b/src/Appwrite/Auth/OAuth2/Etsy.php @@ -39,6 +39,11 @@ class Etsy extends OAuth2 */ private string $pkce = ''; + /** + * @var string + */ + private string $pkceHash = ''; + /** * @return string */ @@ -51,6 +56,18 @@ class Etsy extends OAuth2 return $this->pkce; } + /** + * @return string + */ + private function getPKCEHash(): string + { + if (empty($this->pkceHash)) { + $this->pkceHash = hash('sha256', $this->getPKCE()); + } + + return $this->pkceHash; + } + /** * @return string */ @@ -70,7 +87,7 @@ class Etsy extends OAuth2 'response_type' => 'code', 'state' => \json_encode($this->state), 'scope' => $this->scopes, - 'code_challenge' => $this->getPKCE(), + 'code_challenge' => $this->getPKCEHash(), 'code_challenge_method' => 'S256', ]); } @@ -94,7 +111,7 @@ class Etsy extends OAuth2 'client_id' => $this->appID, 'redirect_uri' => $this->callback, 'code' => $code, - 'code_verifier' => $this->getPKCE(), + 'code_verifier' => $this->getPKCEHash(), ]) ), true); }