Giter Club home page Giter Club logo

Comments (10)

schmidtw avatar schmidtw commented on September 16, 2024 1

from svalinn.

schmidtw avatar schmidtw commented on September 16, 2024 1

from svalinn.

schmidtw avatar schmidtw commented on September 16, 2024 1

from svalinn.

schmidtw avatar schmidtw commented on September 16, 2024

The bearer token you've passed in isn't correct. This is the most relevant line of code:
https://github.com/xmidt-org/bascule/blob/d64a1d71a1e3702e1959ce81f885ec61b5425e69/acquire/parsers.go#L46

It looks like when the JWT token is sent into the JSON unmarshal function, it's not valid JSON.

from svalinn.

pedrojreis avatar pedrojreis commented on September 16, 2024

That looks logic, i've altered the authURL: o the themis's /key/{key}/key.json and now i'm getting a 401 from tr1d1um side :P

"auth":"Bearer","error":"unexpected authorization header value"

I Imagine that i'm missing something from Tr1d1um configuration, but some variables are not clear on what they do :P

I'll attempt to figure it out :)

Thanks for the help @schmidtw

from svalinn.

pedrojreis avatar pedrojreis commented on September 16, 2024

I'll have to boot up a YugaByteDB locally and i'll try to debug it locally.
Can you clear something for me please, is svalinn supposed to register Tr1d1um webhook or Caduceus?
I'm really confused on this and when testing both (With Basic Auth as I'm yet to successfully configure Jwt :P ) :

  • Caduceus /hook and /hooks always returns 404, /api/v4/notify seems to work tho. I've also attempted to add /api/v* to hook(s) and still returns 404. Even when I booted Caduceus locally no breakpoint is triggered when calling /hook
  • Tr1d1um wouldn't allow to register with until and duration are both absent , any clue how can I configure this? I would assume it would be under webhook.request but I've found no configuration for it.

from svalinn.

pedrojreis avatar pedrojreis commented on September 16, 2024

It seems that as of now scytale does not have the /hook endpoint, right? At least as far as i saw in the repo.

I'm linking svalinn to tr1d1um and attempted to add duration: "5m" under webhook.request in the config map but the output is

{"error":"received non-200 response: 400, body: {\"message\":\"failed webhook validation: duration value of webhook is out of bounds: 1347804h7m0.647174144s not between 0 and 0s\"}\n","level":"error","msg":"Failed to register webhook","ts":"2022-07-19T09:55:04.092790321Z"}

Any clue on what i'm doing wrong? 🙂

from svalinn.

schmidtw avatar schmidtw commented on September 16, 2024

from svalinn.

pedrojreis avatar pedrojreis commented on September 16, 2024

No worries 😄

This is my Svalinn Config, i've added the duration under the request as you can see and i believe is correct, however I get the message saying that the duration value of webhook is out of bounds that I quoted in the previous message, ence my confusion on all this.

########################################
#   Webhook Registration Related Configuration
########################################

# webhook provides the information needed to register to a webhook.  If the 
# urls and event regex aren't empty and the interval is greater than 0, 
# registration occurs.
# (Optional)
webhook:
  # registrationInterval provides the time to wait between each registration to 
  # the webhook.  If this is set to 0, no registration is done.
  # (Optional)
  registrationInterval: "4m"

  # timeout provides the length of time the request should wait before timing 
  # out.
  timeout: "1m"

  # registrationURL provides the place to register the webhook.
  registrationURL: "http://tr1d1um.namespace:443/api/v3/hook"

  # request provides the information passed in the webhook registration request.
  request:
    # config provides configuration values for the requests to the webhook 
    # receiver.
    config:
      # url provides the server the webhook should send the events to.  If this 
      # value isn't set, no registration happens.
      url: "http://svalinn.namespace:7100/api/v1/device-status"

      # contentType provides the content type Svalinn expects from the requests 
      # it receives.
      # (Optional) defaults to "wrp"
      contentType: "wrp"

      # secret provides the key for hashing the messages the webhook sends. 
      # If this is empty, no authentication is done later for incoming requests 
      # to Svalinn.
      # (Optional)
      # secret: "super secret"

      # maxRetryCount is the number of times to retry on a failure.
      # (Optional)
      maxRetryCount: 3

      # alternativeURLs provides endpoints to round robin through on a failure 
      # to send an event.  This is only used if the maxRetryCount is greater 
      # than 0.
      # (Optional)
      #AlternativeURLs: []

    # events provides a list of regular expressions that tells the webhook 
    # which endpoints to send to Svalinn.  If the destination of an event 
    # matches a regular expression in this list, it is sent to Svalinn
    events: [".*"]

    # matcher provides regular expressions to match against the event source.
    # (Optional) default is [".*"]
    # matcher:
    #   deviceID: [".*"]

    duration: "5m"

from svalinn.

pedrojreis avatar pedrojreis commented on September 16, 2024

"1m" value returns 1294379h56m18.871345152s.
60 value returns 1m0s

The weirdest part if that tr1d1um is apparently forcing the value to be between 0 and 0s.
I have tr1d1um 0.7.4 - I'll do another look onto tr1d1um.yaml but I don't recall that I have any configuration commented for times, durations and whatnot.

I have traced the error and it lead me to ancla, traced back to tr1d1um and I believe the setting that should be responsible for the max time of the webhook duration should be tr1d1um's webhook.WebhookValidationConfig.max, however upon closer inspection it seems that WebhookValidationConfig has been removed and now ttl is under webhook.

Added:
Ok, it seems that i'm now past that time issue. However if tr1d1um's ttl.max is set for 600 a max os 600ns is returned, i've set it to "5m" and it seems to accept the value now :)

Thank you @schmidtw for all the help 😃

from svalinn.

Related Issues (20)

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.