https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • d

    dave

    02/16/2023, 2:35 AM
    interesting, thank you, lemme see if I can figure out why
  • d

    dave

    02/16/2023, 2:35 AM
    oh I see the openssl part 😛
  • k

    kian

    02/16/2023, 2:35 AM
    try/catch your importKey &
    return Response.json(error)
  • k

    kian

    02/16/2023, 2:35 AM
    you'll get the cause
  • k

    kian

    02/16/2023, 2:36 AM
    (probably invalid spki input)
  • d

    dave

    02/16/2023, 2:39 AM
    fudge right this is why I used jose
  • k

    kian

    02/16/2023, 2:39 AM
    Copy code
    ts
    interface Environment {
      sns_key: CryptoKey
    }
    
    export default {
      async fetch(req, env) {
        return Response.json(env.sns_key);
      },
    };
  • k

    kian

    02/16/2023, 2:39 AM
    :)
  • k

    kian

    02/16/2023, 2:39 AM
    Copy code
    toml
    [[unsafe.bindings]]
    type = "secret_key"
    name = "sns_key"
    format = "spki"
    algorithm = { name = "RSASSA-PKCS1-v1_5", hash = "SHA-256" }
    usages = ["verify"]
    key_base64 = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5YzF4g9Y8VUo4F8DVUcQ2pylVpAiPNyyq2VY5ybkw+jt7ZAKpmdnGKPdFKCfI0TuZvUBABJ6I8yz0Zw2b8oDNmF+W+9cRZ0+G2VU9fakJa0jRrgJBnVecjFKoGDU9YwjDXTfT4LEGWFm8PFsvsyT3cm/4yxIY2Ds4GLmg9ymrXBKFR41qNaRCTKU1VQ+WDXLAHpW8EfIBjIqDg0dncYGu/u0Qx3W/BVy6BPlxMH7exn7wJA1GO6VnDPyyKQ2fwR5ks2omE+J3qRmMYAcQCfjSDAfLw3t4oIPKK1RnRCdK6pgoSFxphF9QlKXn1rmNprC+MbnVnRe0CEymqhGngiQiQIDAQAB"
  • k

    kian

    02/16/2023, 2:39 AM
    wouldn't recommend using this binding
  • k

    kian

    02/16/2023, 2:39 AM
    but it is pretty cool
  • d

    dave

    02/16/2023, 2:39 AM
    yeah wouldn't want to hardcode it 😛
  • k

    kian

    02/16/2023, 2:40 AM
    i suspect one day it'll be like mtls where you can upload a cert w/ wrangler & reference it that way
  • d

    dave

    02/16/2023, 2:41 AM
    I'll just use jose for handling the x509
  • d

    dave

    02/16/2023, 2:41 AM
    thanks for being my rubber duck, pretty sure it was me hammering on trying to parse a x509 cert as a pubkey >_>
  • k

    kian

    02/16/2023, 2:41 AM
    quack
  • k

    kian

    02/16/2023, 2:41 AM
  • d

    dave

    02/16/2023, 2:51 AM
    should I be using ps256 or rs256 when importing with jose?
  • d

    dave

    02/16/2023, 2:53 AM
    yeah RS256 I think
  • d

    dave

    02/16/2023, 4:07 AM
    @kian success! thank you! https://gist.github.com/Manouchehri/5eac5fdf02b159e479e07c1c90f903a7
  • v

    Vonarian

    02/16/2023, 11:27 AM
    Thank you so much for helping, mate! This solved my issue, I have deployed my small API on workers 😄 Really appreciate your help, wish you the best.
  • v

    Vonarian

    02/16/2023, 11:27 AM
    I forgot to notify you last night, I crashed into bed after deploying xD
  • w

    wenzani

    02/16/2023, 11:48 AM
    Hi all
  • w

    wenzani

    02/16/2023, 11:48 AM
    I'm getting a TS error
  • w

    wenzani

    02/16/2023, 11:48 AM
    Copy code
    Type 'Env' has no properties in common with type 'Partial<Environment>'
  • w

    wenzani

    02/16/2023, 11:48 AM
    This didn't come up before, can I ask for some advice on why?
  • g

    Goose0x

    02/16/2023, 1:26 PM
    Error: Failed to publish your Function. Got error: Error: Script startup exceeded CPU time limit. Any help?
  • p

    Plotzes

    02/16/2023, 1:58 PM
    You're probably doing too much stuff in global scope
  • a

    Adrian (Launchpad Cohort)

    02/16/2023, 3:47 PM
    getting a lot of cancelled requests today in CF workers service bindings. Anything happening on CF side?
  • a

    Adrian (Launchpad Cohort)

    02/16/2023, 4:04 PM
    (think I found what's up)
1...227822792280...2509Latest