begin to use strawberry for patching
This commit is contained in:
parent
7694adce3f
commit
5c0a73a92d
3 changed files with 18 additions and 18 deletions
|
@ -8,6 +8,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@atproto/common": "^0.4.5",
|
"@atproto/common": "^0.4.5",
|
||||||
"@atproto/pds": "0.4.77",
|
"@atproto/pds": "0.4.77",
|
||||||
|
"@marshift/strawberry": "^1.5.1",
|
||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.5",
|
||||||
"express": "^4.21.1"
|
"express": "^4.21.1"
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,6 +17,9 @@ importers:
|
||||||
'@atproto/pds':
|
'@atproto/pds':
|
||||||
specifier: 0.4.77
|
specifier: 0.4.77
|
||||||
version: 0.4.77
|
version: 0.4.77
|
||||||
|
'@marshift/strawberry':
|
||||||
|
specifier: ^1.5.1
|
||||||
|
version: 1.5.1
|
||||||
dotenv:
|
dotenv:
|
||||||
specifier: ^16.4.5
|
specifier: ^16.4.5
|
||||||
version: 16.4.7
|
version: 16.4.7
|
||||||
|
@ -450,6 +453,9 @@ packages:
|
||||||
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
|
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
|
|
||||||
|
'@marshift/strawberry@1.5.1':
|
||||||
|
resolution: {integrity: sha512-OtZo6kKA06ceaf9j41r+6UxKAhqHzUnw8jYokLbVHqkQeW88SCxyOlZKOW7uoefnjWQXZcclg5v9xd+NtVe9oA==}
|
||||||
|
|
||||||
'@noble/curves@1.7.0':
|
'@noble/curves@1.7.0':
|
||||||
resolution: {integrity: sha512-UTMhXK9SeDhFJVrHeUJ5uZlI6ajXg10O6Ddocf9S6GjbSBVZsJo88HzKwXznNfGpMTRDyJkqMjNDPYgf0qFWnw==}
|
resolution: {integrity: sha512-UTMhXK9SeDhFJVrHeUJ5uZlI6ajXg10O6Ddocf9S6GjbSBVZsJo88HzKwXznNfGpMTRDyJkqMjNDPYgf0qFWnw==}
|
||||||
engines: {node: ^14.21.3 || >=16}
|
engines: {node: ^14.21.3 || >=16}
|
||||||
|
@ -2701,6 +2707,8 @@ snapshots:
|
||||||
wrap-ansi: 8.1.0
|
wrap-ansi: 8.1.0
|
||||||
wrap-ansi-cjs: wrap-ansi@7.0.0
|
wrap-ansi-cjs: wrap-ansi@7.0.0
|
||||||
|
|
||||||
|
'@marshift/strawberry@1.5.1': {}
|
||||||
|
|
||||||
'@noble/curves@1.7.0':
|
'@noble/curves@1.7.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@noble/hashes': 1.6.0
|
'@noble/hashes': 1.6.0
|
||||||
|
|
|
@ -1,20 +1,11 @@
|
||||||
const provider = require("@atproto/pds/dist/oauth/provider.js");
|
const provider = require("@atproto/pds/dist/oauth/provider.js");
|
||||||
const { OAuthProvider } = require("@atproto/oauth-provider");
|
const { after } = require("@marshift/strawberry");
|
||||||
|
|
||||||
const origProvider = provider.PdsOAuthProvider;
|
after(provider, "PdsOAuthProvider", (_args, provider) => {
|
||||||
class OAuthProviderDetour extends origProvider {
|
after(provider.clientManager.hooks, "onClientInfo", ([clientId], info) => {
|
||||||
constructor(opts) {
|
if (clientId === "https://aglais.pages.dev/oauth/client-metadata.json") {
|
||||||
super(opts);
|
info.isFirstParty = true;
|
||||||
|
info.isTrusted = true;
|
||||||
const oClientInfo = this.clientManager.hooks.onClientInfo;
|
}
|
||||||
this.clientManager.hooks.onClientInfo = (clientId) => {
|
});
|
||||||
const info = oClientInfo(clientId);
|
});
|
||||||
if (clientId === "https://aglais.pages.dev/oauth/client-metadata.json") {
|
|
||||||
info.isFirstParty = true;
|
|
||||||
info.isTrusted = true;
|
|
||||||
}
|
|
||||||
return info;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
provider.PdsOAuthProvider = OAuthProviderDetour;
|
|
||||||
|
|
Loading…
Reference in a new issue