Skip to content

Commit fbdf45c

Browse files
slitRyan R. Fox
authored andcommitted
Rename /protected to /protected-eip3009 in e2e servers
Rename the EVM EIP-3009 payment endpoint from /protected to /protected-eip3009 for consistency with existing naming conventions (/protected-svm, /protected-permit2). Updated servers: - Express (TypeScript) - Hono (TypeScript) - Gin (Go) - FastAPI (Python) - Flask (Python) Also updated test configs, README documentation, and the server protocol specification.
1 parent c75c1c2 commit fbdf45c

15 files changed

Lines changed: 43 additions & 43 deletions

File tree

e2e/servers/express/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This server demonstrates and tests the x402 Express.js middleware with both EVM
1313
-**Settlement Handling** - Payment verification and confirmation
1414

1515
### Protected Endpoints
16-
-`GET /protected` - Requires EVM payment (USDC on Base Sepolia)
16+
-`GET /protected-eip3009` - Requires EIP-3009 payment (USDC on Base Sepolia)
1717
-`GET /protected-svm` - Requires SVM payment (USDC on Solana Devnet)
1818

1919
## What It Demonstrates
@@ -30,7 +30,7 @@ const app = express();
3030

3131
// Define payment requirements for routes
3232
const routes = {
33-
"GET /protected": {
33+
"GET /protected-eip3009": {
3434
scheme: "exact",
3535
network: "eip155:84532",
3636
payTo: "0xYourAddress",
@@ -61,8 +61,8 @@ app.use(x402Middleware({
6161
}));
6262

6363
// Define protected endpoints
64-
app.get("/protected", (req, res) => {
65-
res.json({ message: "EVM payment successful!" });
64+
app.get("/protected-eip3009", (req, res) => {
65+
res.json({ message: "EIP-3009 payment successful!" });
6666
});
6767

6868
app.get("/protected-svm", (req, res) => {

e2e/servers/express/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ app.use(
6666
paymentMiddleware(
6767
{
6868
// Route-specific payment configuration
69-
"GET /protected": {
69+
"GET /protected-eip3009": {
7070
accepts: {
7171
payTo: EVM_PAYEE_ADDRESS,
7272
scheme: "exact",
@@ -162,7 +162,7 @@ app.use(
162162
* This endpoint demonstrates a resource protected by x402 payment middleware.
163163
* Clients must provide a valid payment signature to access this endpoint.
164164
*/
165-
app.get("/protected", (req, res) => {
165+
app.get("/protected-eip3009", (req, res) => {
166166
res.json({
167167
message: "Protected endpoint accessed successfully",
168168
timestamp: new Date().toISOString(),
@@ -238,7 +238,7 @@ app.listen(parseInt(PORT), () => {
238238
║ SVM Payee: ${SVM_PAYEE_ADDRESS}
239239
║ ║
240240
║ Endpoints: ║
241-
║ • GET /protected (EIP-3009 payment)
241+
║ • GET /protected-eip3009 (EIP-3009 payment) ║
242242
║ • GET /protected-svm (SVM payment) ║
243243
║ • GET /protected-permit2 (Permit2 payment) ║
244244
║ • GET /health (no payment required) ║

e2e/servers/express/test.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"endpoints": [
1010
{
11-
"path": "/protected",
11+
"path": "/protected-eip3009",
1212
"method": "GET",
1313
"description": "Protected endpoint requiring EIP-3009 payment",
1414
"requiresPayment": true,

e2e/servers/fastapi/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
# Define routes with payment requirements
7171
routes = {
72-
"GET /protected": {
72+
"GET /protected-eip3009": {
7373
"accepts": {
7474
"scheme": "exact",
7575
"payTo": EVM_ADDRESS,
@@ -157,8 +157,8 @@ async def x402_payment_middleware(request, call_next):
157157
shutdown_requested = False
158158

159159

160-
@app.get("/protected")
161-
async def protected_endpoint() -> Dict[str, Any]:
160+
@app.get("/protected-eip3009")
161+
async def protected_eip3009_endpoint() -> Dict[str, Any]:
162162
"""Protected endpoint that requires payment."""
163163
if shutdown_requested:
164164
raise HTTPException(status_code=503, detail="Server shutting down")

e2e/servers/fastapi/test.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"description": "Python FastAPI server with x402 v2 payment middleware",
1010
"endpoints": [
1111
{
12-
"path": "/protected",
12+
"path": "/protected-eip3009",
1313
"method": "GET",
14-
"description": "Protected endpoint requiring payment",
14+
"description": "Protected endpoint requiring EIP-3009 payment",
1515
"requiresPayment": true,
1616
"protocolFamily": "evm"
1717
},

e2e/servers/flask/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
# Define routes with payment requirements
7070
routes = {
71-
"GET /protected": {
71+
"GET /protected-eip3009": {
7272
"accepts": {
7373
"scheme": "exact",
7474
"payTo": EVM_ADDRESS,
@@ -129,8 +129,8 @@
129129
shutdown_requested = False
130130

131131

132-
@app.route("/protected")
133-
def protected_endpoint():
132+
@app.route("/protected-eip3009")
133+
def protected_eip3009_endpoint():
134134
"""Protected endpoint that requires payment."""
135135
if shutdown_requested:
136136
return jsonify({"error": "Server shutting down"}), 503

e2e/servers/flask/test.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"description": "Python Flask server with x402 v2 payment middleware",
1010
"endpoints": [
1111
{
12-
"path": "/protected",
12+
"path": "/protected-eip3009",
1313
"method": "GET",
14-
"description": "Protected endpoint requiring payment",
14+
"description": "Protected endpoint requiring EIP-3009 payment",
1515
"requiresPayment": true,
1616
"protocolFamily": "evm"
1717
},

e2e/servers/gin/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This server demonstrates and tests the x402 Gin middleware with both EVM and SVM
1313
-**Settlement Handling** - Payment verification and confirmation
1414

1515
### Protected Endpoints
16-
-`GET /protected` - Requires EVM payment (USDC on Base Sepolia)
16+
-`GET /protected-eip3009` - Requires EIP-3009 payment (USDC on Base Sepolia)
1717
-`GET /protected-svm` - Requires SVM payment (USDC on Solana Devnet)
1818

1919
## What It Demonstrates
@@ -36,7 +36,7 @@ r := ginfw.New()
3636

3737
// Define payment routes
3838
routes := x402http.RoutesConfig{
39-
"GET /protected": {
39+
"GET /protected-eip3009": {
4040
Accepts: x402http.PaymentOptions{
4141
{
4242
Scheme: "exact",
@@ -76,8 +76,8 @@ r.Use(ginmw.X402Payment(ginmw.Config{
7676
}))
7777

7878
// Define protected endpoints
79-
r.GET("/protected", func(c *ginfw.Context) {
80-
c.JSON(200, ginfw.H{"message": "EVM payment successful!"})
79+
r.GET("/protected-eip3009", func(c *ginfw.Context) {
80+
c.JSON(200, ginfw.H{"message": "EIP-3009 payment successful!"})
8181
})
8282

8383
r.GET("/protected-svm", func(c *ginfw.Context) {

e2e/servers/gin/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func main() {
8787
/**
8888
* Configure x402 payment middleware
8989
*
90-
* This middleware protects the /protected endpoint with a $0.001 USDC payment requirement
90+
* This middleware protects the /protected-eip3009 endpoint with a $0.001 USDC payment requirement
9191
* on the Base Sepolia testnet with bazaar discovery extension.
9292
*/
9393
// Declare bazaar discovery extension for the GET endpoint
@@ -115,7 +115,7 @@ func main() {
115115
}
116116

117117
routes := x402http.RoutesConfig{
118-
"GET /protected": {
118+
"GET /protected-eip3009": {
119119
Accepts: x402http.PaymentOptions{
120120
{
121121
Scheme: "exact",
@@ -182,7 +182,7 @@ func main() {
182182
* This endpoint demonstrates a resource protected by x402 payment middleware.
183183
* Clients must provide a valid payment signature to access this endpoint.
184184
*/
185-
r.GET("/protected", func(c *ginfw.Context) {
185+
r.GET("/protected-eip3009", func(c *ginfw.Context) {
186186
if shutdownRequested {
187187
c.JSON(http.StatusServiceUnavailable, ginfw.H{
188188
"error": "Server shutting down",
@@ -276,7 +276,7 @@ func main() {
276276
║ SVM Payee: %-40s ║
277277
║ ║
278278
║ Endpoints: ║
279-
║ • GET /protected (requires $0.001 EVM payment)
279+
║ • GET /protected-eip3009 (requires $0.001 EVM)
280280
║ • GET /protected-svm (requires $0.001 SVM payment) ║
281281
║ • GET /health (no payment required) ║
282282
║ • POST /close (shutdown server) ║

e2e/servers/gin/test.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"description": "Go Gin server with x402 v2 payment middleware",
1010
"endpoints": [
1111
{
12-
"path": "/protected",
12+
"path": "/protected-eip3009",
1313
"method": "GET",
14-
"description": "Protected endpoint requiring payment (EVM)",
14+
"description": "Protected endpoint requiring EIP-3009 payment (EVM)",
1515
"requiresPayment": true,
1616
"protocolFamily": "evm"
1717
},

0 commit comments

Comments
 (0)