diff --git a/example/plugins/api-call-example/ui.go b/example/plugins/api-call-example/ui.go index 00dfecf..b7ec67e 100644 --- a/example/plugins/api-call-example/ui.go +++ b/example/plugins/api-call-example/ui.go @@ -13,7 +13,7 @@ import ( func allowedEndpoint(cfg *plugin.ConfigureSpec) (string, error) { // Make an API call to the permitted endpoint client := &http.Client{} - apiURL := fmt.Sprintf("http://localhost:%d/api/access/list", cfg.ZoraxyPort) + apiURL := fmt.Sprintf("http://localhost:%d/plugin/api/access/list", cfg.ZoraxyPort) req, err := http.NewRequest(http.MethodGet, apiURL, nil) if err != nil { return "", fmt.Errorf("error creating request: %v", err) @@ -45,7 +45,7 @@ func allowedEndpoint(cfg *plugin.ConfigureSpec) (string, error) { func allowedEndpointInvalidKey(cfg *plugin.ConfigureSpec) (string, error) { // Make an API call to the permitted endpoint with an invalid key client := &http.Client{} - apiURL := fmt.Sprintf("http://localhost:%d/api/access/list", cfg.ZoraxyPort) + apiURL := fmt.Sprintf("http://localhost:%d/plugin/api/access/list", cfg.ZoraxyPort) req, err := http.NewRequest(http.MethodGet, apiURL, nil) if err != nil { return "", fmt.Errorf("error creating request: %v", err) @@ -98,7 +98,7 @@ func unaccessibleEndpoint(cfg *plugin.ConfigureSpec) (string, error) { func unpermittedEndpoint(cfg *plugin.ConfigureSpec) (string, error) { // Make an API call to an endpoint that is plugin-accessible but is not permitted client := &http.Client{} - apiURL := fmt.Sprintf("http://localhost:%d/api/proxy/list", cfg.ZoraxyPort) + apiURL := fmt.Sprintf("http://localhost:%d/plugin/api/proxy/list", cfg.ZoraxyPort) req, err := http.NewRequest(http.MethodGet, apiURL, nil) if err != nil { return "", fmt.Errorf("error creating request: %v", err) @@ -232,35 +232,36 @@ func RenderUI(config *plugin.ConfigureSpec, w http.ResponseWriter, r *http.Reque

✅ Allowed Endpoint (Valid API Key)

-

Making a GET request to /api/access/list with a valid API key:

+

Making a GET request to /plugin/api/access/list with a valid API key:

` + RenderedAccessListHTML + `
-
-

❌ Invalid API Key

-

Making a GET request to /api/access/list with an invalid API key:

+
+

⚠️ Invalid API Key

+

Making a GET request to /plugin/api/access/list with an invalid API key:

` + RenderedInvalidKeyResponseHTML + `
-

⚠️ Disallowed Endpoint

+

⚠️ Unpermitted Endpoint

+

Making a GET request to /plugin/api/proxy/list (not a permitted endpoint):

+
+ ` + RenderedUnpermittedResponseHTML + ` +
+
+ +
+

❌ Disallowed Endpoint

Making a GET request to /api/acme/listExpiredDomains (not a plugin-accessible endpoint):

` + RenderedUnaccessibleResponseHTML + `
-
-

⚠️ Unpermitted Endpoint

-

Making a GET request to /api/proxy/list (plugin-accessible but not permitted):

-
- ` + RenderedUnpermittedResponseHTML + ` -
-
` w.Write([]byte(html))