Skip to content

Commit

Permalink
feat: Add capability to specify http methods on exposed services (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag authored Oct 2, 2023
1 parent 78f9b2e commit e139dce
Show file tree
Hide file tree
Showing 19 changed files with 750 additions and 394 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,6 @@ data:
}
}
(handle_route_without_auth) {
# handle does not strips the prefix from the request path
handle {args.0}/* {
reverse_proxy {args.1}
import cors
}
}
(handle_path_route_with_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}
import cors
import auth
}
}
(handle_path_route_without_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}
import cors
}
}
(auth) {
auth {
issuer http://example.net/api/auth
Expand All @@ -65,12 +36,65 @@ data:
log {
output stdout
}
import handle_path_route_without_auth /api/auth 127.0.0.1:10002
import handle_path_route_with_auth /api/payments 127.0.0.1:10003
import handle_path_route_with_auth /api/search 127.0.0.1:10004
import handle_path_route_with_auth /api/search-benthos 127.0.0.1:4195
import handle_path_route_with_auth /api/wallets 127.0.0.1:10001
import handle_path_route_with_auth /api/webhooks 127.0.0.1:10005
@authmatcher {
path /api/auth*
}
handle @authmatcher {
uri strip_prefix /api/auth
reverse_proxy 127.0.0.1:10002
import cors
}
@paymentsmatcher {
path /api/payments*
}
handle @paymentsmatcher {
uri strip_prefix /api/payments
reverse_proxy 127.0.0.1:10003
import cors
import auth
}
@searchmatcher {
path /api/search*
}
handle @searchmatcher {
uri strip_prefix /api/search
reverse_proxy 127.0.0.1:10004
import cors
import auth
}
@search-benthosmatcher {
path /api/search-benthos*
}
handle @search-benthosmatcher {
uri strip_prefix /api/search-benthos
reverse_proxy 127.0.0.1:4195
import cors
import auth
}
@walletsmatcher {
path /api/wallets*
}
handle @walletsmatcher {
uri strip_prefix /api/wallets
reverse_proxy 127.0.0.1:10001
import cors
import auth
}
@webhooksmatcher {
path /api/webhooks*
}
handle @webhooksmatcher {
uri strip_prefix /api/webhooks
reverse_proxy 127.0.0.1:10005
import cors
import auth
}
handle /versions {
versions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,6 @@ data:
}
}
(handle_route_without_auth) {
# handle does not strips the prefix from the request path
handle {args.0}/* {
reverse_proxy {args.1}
import cors
}
}
(handle_path_route_with_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}
import cors
import auth
}
}
(handle_path_route_without_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}
import cors
}
}
(auth) {
auth {
issuer http://example.net/api/auth
Expand All @@ -65,14 +36,85 @@ data:
log {
output stdout
}
import handle_path_route_without_auth /api/auth 127.0.0.1:10002
import handle_path_route_with_auth /api/ledger 127.0.0.1:10003
import handle_path_route_with_auth /api/orchestration 127.0.0.1:8080
import handle_path_route_with_auth /api/payments 127.0.0.1:10004
import handle_path_route_with_auth /api/search 127.0.0.1:10005
import handle_path_route_with_auth /api/search-benthos 127.0.0.1:4195
import handle_path_route_with_auth /api/wallets 127.0.0.1:10001
import handle_path_route_with_auth /api/webhooks 127.0.0.1:10006
@authmatcher {
path /api/auth*
}
handle @authmatcher {
uri strip_prefix /api/auth
reverse_proxy 127.0.0.1:10002
import cors
}
@ledgermatcher {
path /api/ledger*
}
handle @ledgermatcher {
uri strip_prefix /api/ledger
reverse_proxy 127.0.0.1:10003
import cors
import auth
}
@orchestrationmatcher {
path /api/orchestration*
}
handle @orchestrationmatcher {
uri strip_prefix /api/orchestration
reverse_proxy 127.0.0.1:8080
import cors
import auth
}
@paymentsmatcher {
path /api/payments*
}
handle @paymentsmatcher {
uri strip_prefix /api/payments
reverse_proxy 127.0.0.1:10004
import cors
import auth
}
@searchmatcher {
path /api/search*
}
handle @searchmatcher {
uri strip_prefix /api/search
reverse_proxy 127.0.0.1:10005
import cors
import auth
}
@search-benthosmatcher {
path /api/search-benthos*
}
handle @search-benthosmatcher {
uri strip_prefix /api/search-benthos
reverse_proxy 127.0.0.1:4195
import cors
import auth
}
@walletsmatcher {
path /api/wallets*
}
handle @walletsmatcher {
uri strip_prefix /api/wallets
reverse_proxy 127.0.0.1:10001
import cors
import auth
}
@webhooksmatcher {
path /api/webhooks*
}
handle @webhooksmatcher {
uri strip_prefix /api/webhooks
reverse_proxy 127.0.0.1:10006
import cors
import auth
}
handle /versions {
versions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,6 @@ data:
}
}
(handle_route_without_auth) {
# handle does not strips the prefix from the request path
handle {args.0}/* {
reverse_proxy {args.1}
import cors
}
}
(handle_path_route_with_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}
import cors
import auth
}
}
(handle_path_route_without_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}
import cors
}
}
(auth) {
auth {
issuer http://example.net/api/auth
Expand All @@ -65,14 +36,85 @@ data:
log {
output stdout
}
import handle_path_route_without_auth /api/auth 127.0.0.1:10002
import handle_path_route_with_auth /api/ledger 127.0.0.1:10003
import handle_path_route_with_auth /api/orchestration 127.0.0.1:8080
import handle_path_route_with_auth /api/payments 127.0.0.1:10004
import handle_path_route_with_auth /api/search 127.0.0.1:10005
import handle_path_route_with_auth /api/search-benthos 127.0.0.1:4195
import handle_path_route_with_auth /api/wallets 127.0.0.1:10001
import handle_path_route_with_auth /api/webhooks 127.0.0.1:10006
@authmatcher {
path /api/auth*
}
handle @authmatcher {
uri strip_prefix /api/auth
reverse_proxy 127.0.0.1:10002
import cors
}
@ledgermatcher {
path /api/ledger*
}
handle @ledgermatcher {
uri strip_prefix /api/ledger
reverse_proxy 127.0.0.1:10003
import cors
import auth
}
@orchestrationmatcher {
path /api/orchestration*
}
handle @orchestrationmatcher {
uri strip_prefix /api/orchestration
reverse_proxy 127.0.0.1:8080
import cors
import auth
}
@paymentsmatcher {
path /api/payments*
}
handle @paymentsmatcher {
uri strip_prefix /api/payments
reverse_proxy 127.0.0.1:10004
import cors
import auth
}
@searchmatcher {
path /api/search*
}
handle @searchmatcher {
uri strip_prefix /api/search
reverse_proxy 127.0.0.1:10005
import cors
import auth
}
@search-benthosmatcher {
path /api/search-benthos*
}
handle @search-benthosmatcher {
uri strip_prefix /api/search-benthos
reverse_proxy 127.0.0.1:4195
import cors
import auth
}
@walletsmatcher {
path /api/wallets*
}
handle @walletsmatcher {
uri strip_prefix /api/wallets
reverse_proxy 127.0.0.1:10001
import cors
import auth
}
@webhooksmatcher {
path /api/webhooks*
}
handle @webhooksmatcher {
uri strip_prefix /api/webhooks
reverse_proxy 127.0.0.1:10006
import cors
import auth
}
handle /versions {
versions {
Expand Down
Loading

1 comment on commit e139dce

@vercel
Copy link

@vercel vercel bot commented on e139dce Oct 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.