Giter VIP home page Giter VIP logo

playground-community's Introduction

KrakenD Playground logo

KrakenD Playground

The KrakenD Playground is a demonstration environment that puts together the necessary pieces to get you started with our API Gateway, using example use-cases.

As KrakenD is an API gateway, we have added surrounding services:

  • Internal and third-party services that feed the gateway
  • Authentication/authorization examples, including JWT token-based authentication with Auth0 integration, a JWT token revoker, API-Key-based authentication, and basic authentication.
  • Integrations with Grafana+Influx (metrics), ELK (log storing and visualization), Jaeger (tracing), and RabbitMQ (for async agents).

KrakenD Docker compose

Demo video

Click to play on Youtube (with subtitles)

Services

The docker-compose.yml includes the following services:

The API Gateway!

On port 8080, you have an instance of KrakenD Enterprise Edition with several endpoints. Its configuration is available at config/krakend/krakend.json, including descriptive @comments for each endpoint.

Fake API backend (Upstream)

On port 8000, you have a simple fake API that provides raw data to the gateway. You can add or remove data by adding XML, JSON, or RSS files in the data folder.

It runs in http://localhost:8000

Metrics, logs & tracing

KrakenD can export telemetry to several services; this demonstration has a few examples. After starting the service and calling some endpoints, you will see the activity in Jaeger, Grafana, and Kibana.

Metrics Logging Tracing
Grafana shows the metrics stored by KrakenD on InfluxDB (credentials: admin/admin) Kibana shows the logs registered by Logstash and persisted in Elasticsearch Jaeger shows the traces of the activity between the client and your end services, including times of hops.
URL: http://localhost:4000 URL: http://localhost:5601 URL: http://localhost:16686
grafana screenshot Kibana screenshot jaeger screenshot

NOTE: To import a Kibana dashboard with some valuable metrics, run in the console the following command once all has started:

    $ make elastic

Web client

This consumer of the API gateway is a simple Express JS application that interacts with KrakenD to fetch the data. All code is under images/spa-auth-web/.

The client is a Single Page Application using Auth0 to generate JWT tokens.

You don't need to install any npm locally; the docker image will download and install the dependencies in the container.

Visit http://localhost:3000

The async agent

A RabbitMQ instance is ready to accept AMQP messages to be delivered to the gateway.

You can insert messages in the krakend queue at http://localhost:15672/#/queues/%2F/krakend (credentials: guest/guest) and see how the async agent picks them and delivers them.

The JWT revoker

A simple implementation of a JWT revoker using the KrakenD remote bloomfilter client.

More information about JWT revoking is available at https://www.krakend.io/docs/authorization/revoking-tokens/

It runs on http://localhost:9000

Start the service

Only if you want to try the Auth0 integration...

Create a new SPA application in Auth0 and fill the autogenerated values they give you under images/spa-auth-web/auth0-variables.js

var AUTH0_CLIENT_ID='AUTH0_CLIENT_ID';
var AUTH0_DOMAIN='AUTH0_DOMAIN';
var AUTH0_AUDIENCE = 'AUTH0_AUDIENCE';

You must do this before starting the docker-compose. If you have started docker-compose before setting these variables, you must build the image again with docker compose build web.

Running the playground

To start the stack included in docker-compose

    $ make start

To follow the KrakenD logs after the complete stack is up & running

    $ make logs

To shut down the complete stack, removing all the volumes

    $ make stop

Play!

Fire up your browser, curl, postman, httpie, or anything else you like to interact with any published services.

When you change the krakend.json, the changes are applied automatically.

💡 Bonus track - Flexible configuration
We've added an example of flexible configuration, so you can view how it works in practice.

Apart from the default config file, krakend.json, you will find a krakend-flexible-config.tmpl that includes some code snippets, invokes a template using variables, and show some basic logic (iterations & conditions).

When working with the flexible configuration, you can optionally ask KrakenD to save the "compiled" output to a file. We've added a command make compile-flexible-config so you can see quickly and easily how KrakenD builds the final configuration file based on the existing templates.

Internally KrakenD's flexible configuration uses Golang templating syntax.

Editing the API Gateway endpoints

To add or remove endpoints, edit the file krakend/krakend.json. The easiest way to do it is by dragging this file to the KrakenD Designer and downloading the edited file. If you move the downloaded file to krakend/krakend.json the server will apply the changes automatically.

The following endpoints are worth noticing:

Feature Endpoint Description
Simple request /public A simple request calling an internal service and returning a JSON response
Data aggregation and manipulation /git/{user} Aggregating multiple calls concurrently and manipulating some data from GitHub API
GraphQL to REST transformation /starwars_films/{movie_id} Transforming a GraphQL query into a regular REST API endpoint
Caching backend responses /market/cached Caching a backend response (based on cache headers provided by the backend)
Concurrent requests /market/concurrent Using concurrent requests to gather data from Coingecko API
Sequential calls /sequential Using sequential proxy to build a pipe of sequential calls, using values from 1st call response into 2nd call request
An aggregated requests with a failing backend /fail An example on how the X-KrakenD-complete header works when a backend fails on an aggregated response
JWT based Authentication /private/auth0 Protects and endpoint validating JWT tokens issued by Auth0

You will find more examples with comments in config/krakend/krakend.json

Contribute!

Everyone can get started with KrakenD at this repository.

Try it out! If it doesn't help you, or you think you can add additional endpoints or middleware integrations, please open a pull request! (We may be too used to KrakenD and don't recognize what a starter demo should include.)

Thanks!


If you have any questions or doubts, you can find our support resources at https://www.krakend.io/support/

Interested in a demo or a trial license of KrakenD Enterprise? Write us »


Note: if you're looking for the KrakenD Enterprise Edition Playground, you'll find it here: https://github.com/krakendio/playground-enterprise

playground-community's People

Contributors

adamtester avatar alombarte avatar corinnekrych avatar dependabot[bot] avatar dhontecillas avatar ethanmdavidson avatar friedcalamari avatar kpacha avatar obokaman-com avatar taik0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

playground-community's Issues

Problem starting up krakend playgound - jwt_revoke build fails

Hi,

I've tried running the playground using "docker-compose up", but it fails while building jwt_revoke. I've tried it both on my Mac and also on a CentOS virtual machine and both display the same error.

Any thoughts? Thanks

[osboxes@osboxes krakend-playground]$ sudo docker-compose up
Building jwt_revoke
Step 1/8 : FROM golang:1.12
 ---> ffcaee6f7d8b
Step 2/8 : RUN mkdir /app
 ---> Using cache
 ---> 8204f106a227
Step 3/8 : WORKDIR /app
 ---> Using cache
 ---> 8075921c488a
Step 4/8 : COPY . .
 ---> Using cache
 ---> ac5c340e8ac0
Step 5/8 : RUN GOPROXY=https://goproxy.io go get -d -v ./...
 ---> Running in 8ea7c7399a22
go: finding github.com/tmthrgd/go-memset v0.0.0-20190303110500-e5f30bc33f57
Fetching https://goproxy.io/github.com/tmthrgd/go-memset/@v/v0.0.0-20190303110500-e5f30bc33f57.info
go: finding github.com/tmthrgd/go-bitwise v0.0.0-20190303101421-46d1dc0ba014
Fetching https://goproxy.io/github.com/tmthrgd/go-bitwise/@v/v0.0.0-20190303101421-46d1dc0ba014.info
go: finding golang.org/x/sys v0.0.0-20190515120540-06a5c4944438
Fetching https://goproxy.io/golang.org/x/sys/@v/v0.0.0-20190515120540-06a5c4944438.info
go: finding github.com/devopsfaith/bloomfilter v0.0.0-20190317200532-4687d0b9aa2a
Fetching https://goproxy.io/github.com/devopsfaith/bloomfilter/@v/v0.0.0-20190317200532-4687d0b9aa2a.info
go: finding github.com/tmthrgd/go-byte-test v0.0.0-20190303110254-b940c25c3738
go: finding github.com/tmthrgd/go-hex v0.0.0-20190303111820-0bdcb15db631
Fetching https://goproxy.io/github.com/tmthrgd/go-byte-test/@v/v0.0.0-20190303110254-b940c25c3738.info
go: finding github.com/tmthrgd/atomics v0.0.0-20190303111459-35961d894d96
Fetching https://goproxy.io/github.com/tmthrgd/atomics/@v/v0.0.0-20190303111459-35961d894d96.info
go: finding github.com/tmthrgd/go-popcount v0.0.0-20190303105726-88afd59bff20
Fetching https://goproxy.io/github.com/tmthrgd/go-popcount/@v/v0.0.0-20190303105726-88afd59bff20.info
go: finding github.com/tmthrgd/go-bitset v0.0.0-20190303105531-b20fba2c981e
Fetching https://goproxy.io/github.com/tmthrgd/go-hex/@v/v0.0.0-20190303111820-0bdcb15db631.info
Fetching https://goproxy.io/github.com/tmthrgd/go-bitset/@v/v0.0.0-20190303105531-b20fba2c981e.info
go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-memset/@v/v0.0.0-20190303110500-e5f30bc33f57.info: dial tcp: i/o timeout
go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-bitwise/@v/v0.0.0-20190303101421-46d1dc0ba014.info: dial tcp: i/o timeout
go: github.com/devopsfaith/[email protected]: Get https://goproxy.io/github.com/devopsfaith/bloomfilter/@v/v0.0.0-20190317200532-4687d0b9aa2a.info: dial tcp: i/o timeout
go: golang.org/x/[email protected]: Get https://goproxy.io/golang.org/x/sys/@v/v0.0.0-20190515120540-06a5c4944438.info: dial tcp: i/o timeout
go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-bitset/@v/v0.0.0-20190303105531-b20fba2c981e.info: dial tcp: i/o timeout
go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-byte-test/@v/v0.0.0-20190303110254-b940c25c3738.info: dial tcp: i/o timeout
go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-popcount/@v/v0.0.0-20190303105726-88afd59bff20.info: dial tcp: i/o timeout
go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/atomics/@v/v0.0.0-20190303111459-35961d894d96.info: dial tcp: i/o timeout
go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-hex/@v/v0.0.0-20190303111820-0bdcb15db631.info: dial tcp: i/o timeout
go: error loading module requirements
ERROR: Service 'jwt_revoke' failed to build: The command '/bin/sh -c GOPROXY=https://goproxy.io go get -d -v ./...' returned a non-zero code: 1

Adding __debug reference to backend results in a 500 error

I am running krackend_ce in debug mode. I have added /__debug/ to the url_pattern for the /private/custom endpoint. When I place the call to http://localhost:8080/private/custom with the debug reference, krakend_ce returns a 500 error:

krakend_ce_1       | [GIN] 2021/02/17 - 21:24:15 | 500 |     24.0597ms |      172.18.0.1 | GET      "/private/custom"
krakend_ce_1       | Error #01: Invalid status code

Here's the config for the endpoint in krakend.json:

    {
      "endpoint": "/private/custom",
      "backend": [
        {
          "url_pattern": "/__debug/user/1.json",
          "extra_config": {}
        }
      ],
      "extra_config": {
        "github.com/devopsfaith/krakend-jose/validator": {
          "alg": "HS256",
          "audience": [
            "http://api.example.com"
          ],
          "roles_key": "roles",
          "issuer": "https://krakend.io",
          "roles": [
            "role_a",
            "role_c",
            "content"
          ],
          "jwk-url": "http://fake_api:8080/jwk/symmetric.json",
          "disable_jwk_security": true
        }
      }
    }

What am I doing wrong?

How to read krakend.json file as remote?

There are many people working on API project. While editing KrakenD configurations, we want everyone to edit in a common area, not their own local environment. For this, we want the krakend.json file to be read from a remote server. How can I do that?

simple pass thru of index.html swagger endpoint

I am trying something similar to this issue in luraproject

Where i am trying to trigger localhost:8010/swagger/index.html which is a html page exposed by swagger-ui container.

I tried this:

"endpoints": [
    {
      "endpoint": "/swagger/",
      "output_encoding": "no-op",
      "backend": [
        {
          "url_pattern": "/swagger/",
          "encoding": "no-op",
          "host": [
            "host.docker.internal:8010"
          ]
        }
      ]
    },
    {
      "endpoint": "/swagger/{a}",
      "output_encoding": "no-op",
      "backend": [
        {
          "url_pattern": "/swagger/{a}",
          "encoding": "no-op",
          "host": [
            "host.docker.internal:8010"
          ]
        }
      ]
    },
    {
      "endpoint": "/swagger/{a}/{b}",
      "output_encoding": "no-op",
      "backend": [
        {
          "url_pattern": "/swagger/{a}/{b}",
          "encoding": "no-op",
          "host": [
            "host.docker.internal:8010"
          ]
        }
      ]
    }

FYI: I am doing a wildcard because /swagger/index.html also triggers /swagger/swagger-ui.css, /swagger/swagger-bundle.js, /swagger/swagger-ui-standalone-preset.js etc files in /swagger/* and /swagger/*/*

Can someone shed light on how to passthrough to this html file.

Error in login

when i click in button login an error is printed no console., and page is redirected for page 404.

env variables in krakend.json failing it to load in KrakenDesigner

Hi,
I am using {{env MY_CUSTOM_ENV}} to pass env variables into my krakend.json.

Able to spinup locally, but when I export file into krakenDesigner or UI to create krakend.json it is complaining about the json format.

How can I overcome this issue? Is this known issue or am i doing it wrong?

How can I disable Auth0 integration?

I have used docker-compose up to run the krakend, but the website let me to login.

How can I disable Auth0 integration?
or how can I get these auth0 params?

var AUTH0_CLIENT_ID='AUTH0_CLIENT_ID';
var AUTH0_DOMAIN='AUTH0_DOMAIN';
var AUTH0_AUDIENCE = 'AUTH0_AUDIENCE';

Couldn't register krakend-bf:1234 in consul: unable to create the consul client: no config

krakend-bf does not start
I tried to add tokens to the filter by postman requests with different parameters "sub", "did", "aud" but the token was not blocked. There is no "jti" parameter in the tokens we are using.
http: // localhost: 9000 / add /? sub = 9cba757816424ae9a57397b3ed516866

OS: win 10 pro

Logs:

PS D:\PROJ\krakend-playground> docker-compose up
Docker Compose is now in the Docker CLI, try docker compose up

Creating network "krakend-playground_default" with the default driver
Creating krakend-playground_web_1 ... done
Creating krakend-playground_fake_api_1 ... done
Creating krakend-playground_kraken_designer_1 ... done
Creating krakend-playground_jaeger_1 ... done
Creating krakend-playground_krakend_ce_1 ... done
Creating krakend-playground_jwt_revoke_1 ... done
Attaching to krakend-playground_web_1, krakend-playground_kraken_designer_1, krakend-playground_fake_api_1, krakend-playground_jaeger_1, krakend-playground_krakend_ce_1, krakend-playground_jwt_revoke_1
jaeger_1 | 2021/05/05 07:44:51 maxprocs: Leaving GOMAXPROCS=6: CPU quota undefined
jaeger_1 | {"level":"info","ts":1620200691.7153509,"caller":"flags/service.go:117","msg":"Mounting metrics handler on admin server","route":"/metrics"}
jaeger_1 | {"level":"info","ts":1620200691.7154102,"caller":"flags/service.go:123","msg":"Mounting expvar handler on admin server","route":"/debug/vars"}
jaeger_1 | {"level":"info","ts":1620200691.7156987,"caller":"flags/admin.go:105","msg":"Mounting health check on admin server","route":"/"}
jaeger_1 | {"level":"info","ts":1620200691.7157815,"caller":"flags/admin.go:111","msg":"Starting admin HTTP server","http-addr":":14269"}
jaeger_1 | {"level":"info","ts":1620200691.7158184,"caller":"flags/admin.go:97","msg":"Admin server started","http.host-port":"[::]:14269","health-status":"unavailable"}
jaeger_1 | {"level":"info","ts":1620200691.7177794,"caller":"memory/factory.go:61","msg":"Memory storage initialized","configuration":{"MaxTraces":0}}
jaeger_1 | {"level":"info","ts":1620200691.7314508,"caller":"server/grpc.go:76","msg":"Starting jaeger-collector gRPC server","grpc.host-port":":14250"}
jaeger_1 | {"level":"info","ts":1620200691.731558,"caller":"server/http.go:47","msg":"Starting jaeger-collector HTTP server","http host-port":":14268"}
jaeger_1 | {"level":"info","ts":1620200691.73241,"caller":"server/zipkin.go:48","msg":"Not listening for Zipkin HTTP traffic, port not configured"}
jaeger_1 | {"level":"info","ts":1620200691.7325687,"caller":"grpc/builder.go:70","msg":"Agent requested insecure grpc connection to collector(s)"}
jaeger_1 | {"level":"info","ts":1620200691.7341266,"caller":"[email protected]/clientconn.go:243","msg":"parsed scheme: ""","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.7341797,"caller":"[email protected]/clientconn.go:249","msg":"scheme "" not registered, fallback to default scheme","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.7342196,"caller":"[email protected]/resolver_conn_wrapper.go:143","msg":"ccResolverWrapper: sending update to cc: {[{:14250 0 }] }","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.7342305,"caller":"[email protected]/clientconn.go:667","msg":"ClientConn switching balancer to "round_robin"","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.734241,"caller":"[email protected]/clientconn.go:682","msg":"Channel switches to new LB policy "round_robin"","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.7343194,"caller":"[email protected]/clientconn.go:1056","msg":"Subchannel Connectivity change to CONNECTING","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.7349603,"caller":"[email protected]/clientconn.go:1193","msg":"Subchannel picks a new address ":14250" to connect","system":"grpc","grpc_log":true}jaeger_1 | {"level":"info","ts":1620200691.7350566,"caller":"grpc/builder.go:108","msg":"Checking connection to collector"}
jaeger_1 | {"level":"info","ts":1620200691.7350695,"caller":"grpc/builder.go:119","msg":"Agent collector connection state change","dialTarget":":14250","status":"IDLE"}
jaeger_1 | {"level":"info","ts":1620200691.7350976,"caller":"[email protected]/clientconn.go:417","msg":"Channel Connectivity change to CONNECTING","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.7351096,"caller":"grpc/builder.go:119","msg":"Agent collector connection state change","dialTarget":":14250","status":"CONNECTING"}
jaeger_1 | {"level":"info","ts":1620200691.7352495,"caller":"[email protected]/clientconn.go:1056","msg":"Subchannel Connectivity change to READY","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.7354512,"caller":"base/balancer.go:200","msg":"roundrobinPicker: newPicker called with info: {map[0xc000455550:{{:14250 0 }}]}","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.7355154,"caller":"[email protected]/clientconn.go:417","msg":"Channel Connectivity change to READY","system":"grpc","grpc_log":true}
jaeger_1 | {"level":"info","ts":1620200691.7355287,"caller":"grpc/builder.go:119","msg":"Agent collector connection state change","dialTarget":":14250","status":"READY"}
jaeger_1 | {"level":"info","ts":1620200691.7354705,"caller":"command-line-arguments/main.go:218","msg":"Starting agent"}
jaeger_1 | {"level":"info","ts":1620200691.7355957,"caller":"querysvc/query_service.go:137","msg":"Archive storage not created","reason":"archive storage not supported"}
jaeger_1 | {"level":"info","ts":1620200691.7356062,"caller":"app/flags.go:128","msg":"Archive storage not initialized"}
jaeger_1 | {"level":"info","ts":1620200691.73561,"caller":"app/agent.go:69","msg":"Starting jaeger-agent HTTP server","http-port":5778}
jaeger_1 | {"level":"info","ts":1620200691.7366421,"caller":"app/static_handler.go:181","msg":"UI config path not provided, config file will not be watched"}
jaeger_1 | {"level":"info","ts":1620200691.736794,"caller":"app/server.go:170","msg":"Query server started"}
jaeger_1 | {"level":"info","ts":1620200691.7368107,"caller":"healthcheck/handler.go:129","msg":"Health Check state change","status":"ready"}
jaeger_1 | {"level":"info","ts":1620200691.7368236,"caller":"app/server.go:249","msg":"Starting GRPC server","port":16685,"addr":":16685"}
jaeger_1 | {"level":"info","ts":1620200691.736843,"caller":"app/server.go:230","msg":"Starting HTTP server","port":16686,"addr":":16686"}
kraken_designer_1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
kraken_designer_1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
kraken_designer_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
kraken_designer_1 | 10-listen-on-ipv6-by-default.sh: Getting the checksum of /etc/nginx/conf.d/default.conf
kraken_designer_1 | 10-listen-on-ipv6-by-default.sh: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
kraken_designer_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
kraken_designer_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
krakend_ce_1 | Parsing configuration file: /etc/krakend/krakend.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.360 ▶ ERROR unable to create the GELF writer: getting the extra config for the krakend-gelf module
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.360 ▶ INFO Listening on port: 8080
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.360 ▶ DEBUG creating a new influxdb client
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.360 ▶ DEBUG no config for the influxdb client. Aborting
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.360 ▶ WARNIN influxdb: unable to load custom config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.360 ▶ INFO registering usage stats for cluster ID 'OxrJIzABARWod4je0vApwtIxNdnC/jggJVE4SK708tQ='
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.363 ▶ ERROR Couldn't register krakend-bf:1234 in consul: unable to create the consul client: no config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ WARNIN no config present for the httpsecure module
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG botdetector middleware: no config defined for the module
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG AMQP: http://fake_api:8080: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG AMQP: http://fake_api:8080: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG pubsub: subscriber (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG pubsub: publisher (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG http-request-executor: no extra config for backend /shop/campaigns.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG CEL: no extra config detected for backend /shop/campaigns.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG AMQP: http://fake_api:8080: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG AMQP: http://fake_api:8080: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG pubsub: subscriber (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
web_1 | npm info it worked if it ends with ok
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG pubsub: publisher (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG http-request-executor: no extra config for backend /shop/products.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG CEL: no extra config detected for backend /shop/products.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG CEL: no extra config detected for pipe /splash
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ INFO JOSE: signer disabled for the endpoint /splash
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ INFO JOSE: validator disabled for the endpoint /splash
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG botdetector: no config defined for the module
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG AMQP: http://fake_api:8080: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG AMQP: http://fake_api:8080: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG pubsub: subscriber (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG pubsub: publisher (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG http-request-executor: no extra config for backend /hotels/1.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG CEL: no extra config detected for backend /hotels/1.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.364 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: http://fake_api:8080: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: http://fake_api:8080: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: subscriber (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: publisher (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG http-request-executor: no extra config for backend /destinations/{{.Resp0_destination_id}}.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for backend /destinations/{{.Resp0_destination_id}}.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for pipe /sequential
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ INFO JOSE: signer disabled for the endpoint /sequential
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ INFO JOSE: validator disabled for the endpoint /sequential
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG botdetector: no config defined for the module
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: http://fake_api:8080: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: http://fake_api:8080: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: subscriber (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: publisher (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG http-request-executor: no extra config for backend /user/1.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for backend /user/1.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: http://fake_url_that_should_not_resolve.tld: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: http://fake_url_that_should_not_resolve.tld: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: subscriber (http://fake_url_that_should_not_resolve.tld): github.com/devopsfaith/krakend-pubsub/subscriber not found in the
extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: publisher (http://fake_url_that_should_not_resolve.tld): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG http-request-executor: no extra config for backend /
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for backend /
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for pipe /fail
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ INFO JOSE: signer disabled for the endpoint /fail
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ INFO JOSE: validator disabled for the endpoint /fail
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG botdetector: no config defined for the module
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: https://api.github.com: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: https://api.github.com: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: subscriber (https://api.github.com): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: publisher (https://api.github.com): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG http-request-executor: no extra config for backend /users/kpacha
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for backend /users/kpacha
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: https://api.bitbucket.org: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: https://api.bitbucket.org: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: subscriber (https://api.bitbucket.org): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: publisher (https://api.bitbucket.org): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG http-request-executor: no extra config for backend /2.0/users/kpacha
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for backend /2.0/users/kpacha
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for pipe /public
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ INFO JOSE: signer disabled for the endpoint /public
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ INFO JOSE: validator disabled for the endpoint /public
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG botdetector: no config defined for the module
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: http://fake_api:8080: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG AMQP: http://fake_api:8080: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: subscriber (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG pubsub: publisher (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG http-request-executor: no extra config for backend /user/1.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for backend /user/1.json
web_1 | npm info using [email protected]
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.365 ▶ DEBUG CEL: no extra config detected for pipe /private/auth0
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.366 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.366 ▶ INFO JOSE: signer disabled for the endpoint /private/auth0
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.366 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ INFO JOSE: validator enabled for the endpoint /private/auth0
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG botdetector: no config defined for the module
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG AMQP: http://fake_api:8080: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG AMQP: http://fake_api:8080: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG pubsub: subscriber (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG pubsub: publisher (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/publisher not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG http-request-executor: no extra config for backend /user/1.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG CEL: no extra config detected for backend /user/1.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG CEL: no extra config detected for pipe /private/custom
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ INFO JOSE: signer disabled for the endpoint /private/custom
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.396 ▶ INFO JOSE: validator enabled for the endpoint /private/custom
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.397 ▶ DEBUG botdetector: no config defined for the module
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.397 ▶ DEBUG AMQP: http://fake_api:8080: no amqp consumer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.397 ▶ DEBUG AMQP: http://fake_api:8080: no amqp producer defined
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.397 ▶ DEBUG pubsub: subscriber (http://fake_api:8080): github.com/devopsfaith/krakend-pubsub/subscriber not found in the extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.397 ▶ DEBUG http-request-executor: no extra config for backend /token.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.397 ▶ DEBUG CEL: no extra config detected for backend /token.json
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.397 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.397 ▶ DEBUG CEL: no extra config detected for pipe /token
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.397 ▶ DEBUG lua: no extra config
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.409 ▶ INFO JOSE: signer enabled for the endpoint /token
krakend_ce_1 | [KRAKEND] 2021/05/05 - 07:44:52.409 ▶ DEBUG botdetector: no config defined for the module
web_1 | npm info lifecycle [email protected]prestart: [email protected]
web_1 | npm info lifecycle [email protected]
start: [email protected]
web_1 |
web_1 | > [email protected] start /home/app
web_1 | > serve -p 3000
web_1 |
web_1 | INFO: Accepting connections at http://localhost:3000

impossible to login to :8080

running make run, I can see in the docker log:
[00] [KRAKEND] 2023/12/18 - 11:23:45.401 ▶ ERROR [SERVICE: Asyncagent][async-agent-demo] building the amqp subscriber: dial tcp 192.168.64.5:5672: connect: connection refused

I can't connect to the docker using port 8080 or 8090, I have the error:
404 page not found
I can't see anything about it in the log (make logs or container log)

ERROR writing to influx: {"code":"unauthorized","message":"unauthorized access"}

Hello,
I cloned the krakend-playground repo then ran docker-compose up in its directory, everything seemed to go ok until I hit this message spamming over and over:

krakend_ce_1       | [KRAKEND] 2021/06/11 - 18:42:52.702 ▶ DEBUG Preparing influxdb points
krakend_ce_1       | [KRAKEND] 2021/06/11 - 18:42:52.708 ▶ ERROR writing to influx: {"code":"unauthorized","message":"unauthorized access"}
krakend_ce_1       | [KRAKEND] 2021/06/11 - 18:43:17.702 ▶ DEBUG Preparing influxdb points
krakend_ce_1       | [KRAKEND] 2021/06/11 - 18:43:17.708 ▶ ERROR writing to influx: {"code":"unauthorized","message":"unauthorized access"}
krakend_ce_1       | [KRAKEND] 2021/06/11 - 18:43:42.721 ▶ DEBUG Preparing influxdb points
krakend_ce_1       | [KRAKEND] 2021/06/11 - 18:43:42.727 ▶ ERROR writing to influx: {"code":"unauthorized","message":"unauthorized access"}

I've let this run for roughly 15 minutes thinking that maybe I was waiting on something in the container to start up, but it keeps spinning. Anything I need to adjust on my end to allow it to proceed? Thanks!

Error on login Click

After click on login it shows:

Callback URL mismatch.
The provided redirect_uri is not in the list of allowed callback URLs.
what url should be added??
image

POST - request body doesnt propagate to backend.

Has anyone encountered this issue before? I'm unable to access my req.body in the backend.

{
      "endpoint": "/v1/test",
      "method": "POST",
      "output_encoding": "json",
      "backend": [
        {
          "url_pattern": "/test",
          "encoding": "json",
          "sd": "static",
          "method": "POST",
          "host": [
            "localhost:11111"
          ],
          "disable_host_sanitize": false
        },
        "input_headers": [
          "Content-Type"
        ]
      ]
    }

Unable to build with flexible configuration

Hi,

A problem occurred when I tried to build my flexible configuration

=> ERROR [builder 3/3] RUN FC_ENABLE=1 FC_SETTINGS="$PWD/config/settings" FC_PARTIALS="$PWD/config/parti 0.2s

[builder 3/3] RUN FC_ENABLE=1 FC_SETTINGS="$PWD/config/settings" FC_PARTIALS="$PWD/config/partials" krakend check -t -d -c "$PWD/config/krakend.json":
#7 0.233 Parsing configuration file: /etc/krakend/config/krakend.json
#7 0.235 ERROR parsing the configuration file: '/tmp/KrakenD_parsed_config_template_4097533881.json': invalid character '{' looking for beginning of object key string, offset: 1652, row: 23, col: 13

Dockerfile:

FROM devopsfaith/krakend as builder

COPY config . /etc/krakend/config

RUN FC_ENABLE=1 \
FC_SETTINGS="$PWD/config/settings" \
FC_PARTIALS="$PWD/config/partials" \
krakend check -t -d -c "$PWD/config/krakend.json"

FROM devopsfaith/krakend
COPY --from=builder --chown=krakend /tmp/krakend.json .

krakend.json:
{
"version": 3,
"port": {{ .service.port }},
"extra_config": {{ marshal .service.extra_config }},
"host": {{ marshal .service.default_hosts }},
"endpoints": [
{{ range $idx, $endpoint := .endpoint.example_group }}
{{if $idx}},{{end}}
{
"endpoint": "{{ $endpoint.endpoint }}",
"backend": [
{
"url_pattern": "{{ $endpoint.backend }}",
"extra_config": {
{{ include "rate_limit_backend.tmpl" }}
}
}
]
{{ end }}
]
}

Could you please let me know what I'm missing?

Can we return a flat list for collection?

When I add endpoint manipulation for the response collection, the response I getting is like:

{
    "return_collection_name": [
        { ... },
        { ... }
   ]
}

But I am expecting to get:

[
   { ... },
   { ... }
]

Shed some insights if it is possible.

kid header is required by the JWT validator

I am trying to config krakend to my local symetric key to validate incoming JWT Bearer tokens, my key.json file:

{
	"keys": [
		{
			"kty": "oct",
			"k": "123",
			"kid": "key_one",
			"alg": "HS256"
		}
	]
}

and the config.json definition is:

{
  "version": 2,
  "timeout": "6000ms",
  "cache_ttl": "300s",
  "output_encoding": "no-op",
  "name": "cloud_api",
  "port": 8768,
  "disable_rest": true,
  "extra_config": {
    "github_com/devopsfaith/krakend-gologging": {
      "level":  "DEBUG",
      "prefix": "[KRAKEND]",
      "syslog": false,
      "stdout": true
    }
  },
  "endpoints": [
    {
      "endpoint": "/identity/project/",
      "method": "GET",
      "querystring_params":["*"],
      "headers_to_pass":["*"],
      "output_encoding": "no-op",
      "extra_config": {
        "github.com/devopsfaith/krakend/proxy": {
          "sequential": false
        },
        "github.com/devopsfaith/krakend-jose/validator": {
          "alg": "HS256",
          "jwk_local_path": "./jwk.json",
          "disable_jwk_security": true
        }
      },
      "backend": [
        {
          "url_pattern": "/project/",
          "encoding": "no-op",
          "sd": "static",
          "method": "GET",
          "extra_config": {},
          "host": [
            "172.20.92.123:8909"
          ],
          "disable_host_sanitize": false
        }
      ]
    }
  ]
}

when I try to send a request to the endpoint I get the exception:

2021/06/27 10:58:19 [Recovery] 2021/06/27 - 10:58:19 panic recovered:
GET /identity/project/?account_id=3 HTTP/1.1
Host: 172.20.92.123:8768
Accept: */*
Authorization: *
User-Agent: curl/7.68.0
X-Csrftoken: Fg4XyNvnhGQByUU7pBciweSSqABd7jVqkxIRaHqj7RApUJwAvnCrTyuSPs17XYE2


runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:212 (0xd4e35a)
        panicmem: panic(memoryError)
/usr/local/go/src/runtime/signal_unix.go:734 (0xd67512)
        sigpanic: panicmem()
/go/pkg/mod/github.com/auth0-community/[email protected]/jwk_client.go:80 (0x1e7fbcf)
/go/pkg/mod/github.com/devopsfaith/[email protected]/jwk_client.go:91 (0x200fedc)
/go/pkg/mod/github.com/auth0-community/[email protected]/auth0.go:102 (0x1e7f5c4)
/go/pkg/mod/github.com/devopsfaith/[email protected]/gin/jose.go:119 (0x21a4737)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x1917a79)
/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x1917a60)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x1916b53)
/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0x1916b12)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x190cd09)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:489 (0x190ccef)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x190c7db)
/usr/local/go/src/net/http/server.go:2887 (0x10b0302)
        serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/local/go/src/net/http/server.go:1952 (0x10ab72c)
        (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/local/go/src/runtime/asm_amd64.s:1371 (0xd88e40)
        goexit: BYTE    $0x90   // NOP

[GIN] 2021/06/27 - 10:58:19 | 500 |     1.68196ms |     172.30.5.32 | GET      "/identity/project/?account_id=3"

what is the cause of runtime error: invalid memory address or nil pointer dereference? and how can I config my krakend to validate tokens with a local jwk?

"target" : feature not working

if i try to use target feature in krakend.json in any backend configuration file then that backend is giving an empty data i.e it is just showing {} if tried to curl apigateway/any_endpoint

Does not work on arm64 MacOS

I would like to run the playground on a m1 Mac (arm64 architecture). There are two issues:

  • the krakend:watch image is only available as amd64. I can work around this using krakend:latest
  • the "fake_api" (ghcr.io/lpereira/lwan:latest) image is only available as amd64

Please update (or bake the fake_api in to the playground, or provide some suitable alternatives)

What I get when running docker-compose up

`# docker-compose up

Building jwt_revoke

Step 1/8 : FROM golang:1.12
---> f50db16df5da

Step 2/8 : RUN mkdir /app
---> Using cache
---> fb75e30d0dd4

Step 3/8 : WORKDIR /app
---> Using cache
---> 18cc7a3d28ee

Step 4/8 : COPY . .
---> Using cache
---> 795c218d1a5b

Step 5/8 : RUN GOPROXY=https://goproxy.io go get -d -v ./...
---> Running in c99a0effc44e

go: finding github.com/tmthrgd/go-memset v0.0.0-20190303110500-e5f30bc33f57
Fetching https://goproxy.io/github.com/tmthrgd/go-memset/@v/v0.0.0-20190303110500-e5f30bc33f57.info

go: finding github.com/devopsfaith/bloomfilter v0.0.0-20190317200532-4687d0b9aa2a
Fetching https://goproxy.io/github.com/devopsfaith/bloomfilter/@v/v0.0.0-20190317200532-4687d0b9aa2a.info

go: finding github.com/tmthrgd/atomics v0.0.0-20190303111459-35961d894d96
Fetching https://goproxy.io/github.com/tmthrgd/atomics/@v/v0.0.0-20190303111459-35961d894d96.info

go: finding github.com/tmthrgd/go-bitwise v0.0.0-20190303101421-46d1dc0ba014
Fetching https://goproxy.io/github.com/tmthrgd/go-bitwise/@v/v0.0.0-20190303101421-46d1dc0ba014.info

go: finding github.com/tmthrgd/go-hex v0.0.0-20190303111820-0bdcb15db631
Fetching https://goproxy.io/github.com/tmthrgd/go-hex/@v/v0.0.0-20190303111820-0bdcb15db631.info

go: finding github.com/tmthrgd/go-byte-test v0.0.0-20190303110254-b940c25c3738
Fetching https://goproxy.io/github.com/tmthrgd/go-byte-test/@v/v0.0.0-20190303110254-b940c25c3738.info

go: finding github.com/tmthrgd/go-bitset v0.0.0-20190303105531-b20fba2c981e
Fetching https://goproxy.io/github.com/tmthrgd/go-bitset/@v/v0.0.0-20190303105531-b20fba2c981e.info

go: finding github.com/tmthrgd/go-popcount v0.0.0-20190303105726-88afd59bff20

go: finding golang.org/x/sys v0.0.0-20190515120540-06a5c4944438
Fetching https://goproxy.io/github.com/tmthrgd/go-popcount/@v/v0.0.0-20190303105726-88afd59bff20.info
Fetching https://goproxy.io/golang.org/x/sys/@v/v0.0.0-20190515120540-06a5c4944438.info

go: github.com/devopsfaith/[email protected]: Get https://goproxy.io/github.com/devopsfaith/bloomfilter/@v/v0.0.0-20190317200532-4687d0b9aa2a.info: EOF

go: golang.org/x/[email protected]: Get https://goproxy.io/golang.org/x/sys/@v/v0.0.0-20190515120540-06a5c4944438.info: EOF

go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/atomics/@v/v0.0.0-20190303111459-35961d894d96.info: EOF

go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-hex/@v/v0.0.0-20190303111820-0bdcb15db631.info: EOF

go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-popcount/@v/v0.0.0-20190303105726-88afd59bff20.info: EOF

go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-bitwise/@v/v0.0.0-20190303101421-46d1dc0ba014.info: EOF

go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-memset/@v/v0.0.0-20190303110500-e5f30bc33f57.info: EOF

go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-byte-test/@v/v0.0.0-20190303110254-b940c25c3738.info: EOF

go: github.com/tmthrgd/[email protected]: Get https://goproxy.io/github.com/tmthrgd/go-bitset/@v/v0.0.0-20190303105531-b20fba2c981e.info: EOF

go: error loading module requirements
ERROR: Service 'jwt_revoke' failed to build: The command '/bin/sh -c GOPROXY=https://goproxy.io go get -d -v ./...' returned a non-zero code: 1
`

What am I doing wrong?

change signer to rsa

hi. I tried to change the sign and validator to rsa mode.
however I fail to do it.
My config is like this:
"extra_config": {
"github.com/devopsfaith/krakend-jose/signer": {
"alg": "RS256",
"kty":"RSA",
"kid": "2011-04-29",
"keys-to-sign": ["access_token", "refresh_token"],
"jwk-url": "http://fake_api:8080/jwk/public.json",
"disable_jwk_security": true
}

ERROR JOSE: unable to create the signer for the endpoint /token
ERROR square/go-jose: unsupported key type/format

Im new to Golang...Do I have to do this by checking krakend-jose

npm ERR during installation! An error occurs.

I try it in company. env firewall
and Install env is windows WSL Ubuntu 22.04.2 LTS
first problem is docker download,
then I solved by "fake authority"(https://stackoverflow.com/questions/50619911/docker-get-https-registry-1-docker-io-v2-x509-certificate-signed-by-unkno).

second.
try again. docker-compose up
then blow error "npm ERR! code SELF_SIGNED_CERT_IN_CHAIN"

Could I have solution?

root@TAEWOO:/opt/krakend/playground-community-master# docker-compose up
Building web
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  23.04kB
Step 1/7 : FROM node:12-alpine
 ---> bb6d28039b8c
Step 2/7 : WORKDIR /home/app
 ---> Using cache
 ---> d035400f6383
Step 3/7 : ADD package.json /home/app
 ---> Using cache
 ---> e6fc714ac83f
Step 4/7 : RUN npm install
 ---> Running in 0dac6ea149da
npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/express-jwt failed, reason: self signed certificate in certificate chain

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-11-24T06_53_47_726Z-debug.log
The command '/bin/sh -c npm install' returned a non-zero code: 1
ERROR: Service 'web' failed to build : Build failed
root@TAEWOO:/opt/krakend/playground-community-master# npm config get strict-ssl
false

CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'

Hi I followed the recommendation about cors from the document, but I'm still get the following error:

Access to XMLHttpRequest at 'http:///api/v1/payment' from origin 'http://' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

This is my configuration:

endpoints:

[
{
"@comment": "this won't fail because CORS preflight headers are removed from the request to the backend",
"endpoint": "/api/v1/payment",
"input_headers": [
"*"
],
"output_encoding": "no-op",
"backend": [
{
"url_pattern": "/api/v1/payment",
"host": [
"http://*****"
],
"encoding": "no-op",
"extra_config": {
"modifier/martian": {
"fifo.Group": {
"scope": [
"request",
"response"
],
"aggregateErrors": true,
"modifiers": [
{
"header.Blacklist": {
"scope": [
"request"
],
"names": [
"Access-Control-Request-Method",
"Sec-Fetch-Dest",
"Sec-Fetch-Mode",
"Sec-Fetch-Site",
"Origin"
]
}
}
]
}
}
}
}
]
}
]

Krakend.json :

{
"version": 3,
"port": {{ marshal .service.port }},
"cache_ttl": {{ marshal .service.cache_ttl }},
"timeout": {{ marshal .service.timeout }},
"extra_config": {{ marshal .service.extra_config }},
"host": {{ marshal .service.default_hosts }},
"endpoints": [
{{ range $idx, $endpoint := .endpoint.example_group }}
{{if $idx}},{{end}}
{
"endpoint": "{{ $endpoint.endpoint }}",
"method": "{{ $endpoint.method }}",
"headers_to_pass":["*"],
"extra_config:":{{ marshal $endpoint.extra_config }},
"output_encoding": "no-op",
"backend": {{ marshal $endpoint.backend }}
}
{{ end }}

    ]
}

service.json
{
"port": 8080,
"cache_ttl": "3600s",
"timeout": "36s",
"default_hosts": [
"http://:30003",
"http://
:30004",
"http://:30007"
],
"extra_config": {
"security/cors": {
"allow_origins": [
"http*"
],
"allow_methods": [
"GET",
"HEAD",
"POST",
"PUT",
"DELETE"
],
"expose_headers": [
"Content-Length",
"Content-Type"
],
"allow_headers": [
"Origin",
"Authorization",
"Content-Type",
"Cache-Control",
"Pragma",
"Accept-Language"
],
"max_age": "12h",
"allow_credentials": false,
"debug": false
},
"telemetry/logging": {
"level": "DEBUG",
"prefix": "[KRAKEND]",
"syslog": false,
"stdout": true
},
"telemetry/opencensus": {
"exporters": {
"jaeger": {
"endpoint": "
/api/traces",
"service_name": "krakend",
"buffer_max_count": 1000
}
}
},
"telemetry/metrics": {
"collection_time": "60s",
"proxy_disabled": false,
"router_disabled": false,
"backend_disabled": false,
"endpoint_disabled": false,
"listen_address": ":8090"
}
}
}

Could you please tell me where I made a mistake?

Thanks

=> ERROR [fake_api 1/1] FROM docker.io/jaxgeller/lwan@sha256:f7e799638df21fa6e0bc7b6e1b4937b1fbefdf0cad772ef318d5477c446feb63

I facing error with cache key and there is nothing like "http://fake_api:8080" as stated in krakend.json


[fake_api 1/1] FROM docker.io/jaxgeller/lwan@sha256:f7e799638df21fa6e0bc7b6e1b4937b1fbefdf0cad772ef318d5477c446feb63:


failed to solve: rpc error: code = Unknown desc = failed to load cache key: invalid empty config file resolved for docker.io/jaxgeller/lwan@sha256:f7e799638df21fa6e0bc7b6e1b4937b1fbefdf0cad772ef318d5477c446feb63

docker compose breacks

we recibe a time out on jwt_revoke maybe the url change?, the demo is not working out of the box.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.