mirror of
https://github.com/tlsnotary/tlsn-plugin-boilerplate.git
synced 2026-01-08 04:23:52 -05:00
Merge pull request #25 from tlsnotary/plugin-cleanup
Plugin Cleanup of leftover code
This commit is contained in:
@@ -40,7 +40,7 @@ export function start() {
|
||||
|
||||
/**
|
||||
* Implementation of step "two".
|
||||
* This step collects and validates authentication cookies and headers for 'api.x.com'.
|
||||
* This step collects and validates authentication cookies and headers for 'axisbank.com'.
|
||||
* If all required information, it creates the request object.
|
||||
* Note that the url needs to be specified in the `config` too, otherwise the request will be refused.
|
||||
*/
|
||||
@@ -94,10 +94,10 @@ export function two() {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to parse the Twitter response and specify what information is revealed (i.e. **not** redacted)
|
||||
* This method is used to parse the Axis Bank response and specify what information is revealed (i.e. **not** redacted)
|
||||
* This method is optional in the notarization request. When it is not specified nothing is redacted.
|
||||
*
|
||||
* In this example it locates the `screen_name` and excludes that range from the revealed response.
|
||||
* In this example it locates the `CUST_NAME` and excludes that range from the revealed response.
|
||||
*/
|
||||
export function parseAxisResp() {
|
||||
console.log("parseAxisResp: Starting function");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "discord_dm",
|
||||
"version": "1.0.0",
|
||||
"description": "Demo TLSNotary plugin to notarize the ownership of a twitter profile",
|
||||
"description": "Demo TLSNotary plugin to notarize the ownership of a discord DM",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "node esbuild.js"
|
||||
|
||||
1
examples/discord_dm/src/index.d.ts
vendored
1
examples/discord_dm/src/index.d.ts
vendored
@@ -4,7 +4,6 @@ declare module 'main' {
|
||||
export function parseDiscordDm(): I32;
|
||||
export function three(): I32;
|
||||
export function config(): I32;
|
||||
export function parseDiscordDm(): I32;
|
||||
}
|
||||
|
||||
declare module 'extism:host' {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "discord_profile",
|
||||
"version": "1.0.0",
|
||||
"description": "Demo TLSNotary plugin to notarize the ownership of a twitter profile",
|
||||
"description": "Demo TLSNotary plugin to notarize the ownership of a discord profile",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "node esbuild.js"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "idme_profile",
|
||||
"version": "1.0.0",
|
||||
"description": "Demo TLSNotary plugin to notarize the ownership of a twitter profile",
|
||||
"description": "Demo TLSNotary plugin to notarize the ownership of a id.me profile",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "node esbuild.js"
|
||||
|
||||
2
examples/id_me/src/index.d.ts
vendored
2
examples/id_me/src/index.d.ts
vendored
@@ -2,7 +2,7 @@ declare module 'main' {
|
||||
// Extism exports take no params and return an I32
|
||||
export function start(): I32;
|
||||
export function two(): I32;
|
||||
export function parseTwitterResp(): I32;
|
||||
export function parseIdentity(): I32;
|
||||
export function three(): I32;
|
||||
export function config(): I32;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ export function start() {
|
||||
|
||||
/**
|
||||
* Implementation of step "two".
|
||||
* This step collects and validates authentication cookies and headers for 'api.x.com'.
|
||||
* This step collects and validates authentication cookies and headers for 'account.id.me'.
|
||||
* If all required information, it creates the request object.
|
||||
* Note that the url needs to be specified in the `config` too, otherwise the request will be refused.
|
||||
*/
|
||||
@@ -99,10 +99,10 @@ export function two() {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to parse the Twitter response and specify what information is revealed (i.e. **not** redacted)
|
||||
* This method is used to parse the ID.me response and specify what information is revealed (i.e. **not** redacted)
|
||||
* This method is optional in the notarization request. When it is not specified nothing is redacted.
|
||||
*
|
||||
* In this example it locates the `screen_name` and excludes that range from the revealed response.
|
||||
* In this example it locates the `full_name` and excludes that range from the revealed response.
|
||||
*/
|
||||
export function parseIdentity() {
|
||||
const bodyString = Host.inputString();
|
||||
|
||||
@@ -35,7 +35,7 @@ export function start() {
|
||||
|
||||
/**
|
||||
* Implementation of step "two".
|
||||
* This step collects and validates authentication cookies and headers for 'api.x.com'.
|
||||
* This step collects and validates authentication cookies and headers for 'api.spotify.com'.
|
||||
* If all required information, it creates the request object.
|
||||
* Note that the url needs to be specified in the `config` too, otherwise the request will be refused.
|
||||
*/
|
||||
@@ -53,9 +53,8 @@ export function two() {
|
||||
url: 'https://api.spotify.com/v1/me/top/artists?time_range=medium_term&limit=1',
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'x-twitter-client-language': 'en',
|
||||
'x-csrf-token': headers['x-csrf-token'],
|
||||
Host: 'api.x.com',
|
||||
Host: 'api.spotify.com',
|
||||
authorization: headers.authorization,
|
||||
Connection: 'close',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user