mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Adds sha256 to etsy pkce based auth
Updates requests to use hash instead of plain text
This commit is contained in:
@@ -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
|
||||
+1
-1
Submodule app/console updated: 5e2a40c1e3...de73c020a7
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user