Giter VIP home page Giter VIP logo

Comments (13)

mruoss avatar mruoss commented on May 28, 2024 1

I created a pull request, but have not had time to test it yet. No clue where that content- prefix came from. Must be some copy-paste from somewhere. But I guess I forgot where I took it from...

from gcs_signed_url.

camelpunch avatar camelpunch commented on May 28, 2024 1

Of course, this time I tried, it worked absolutely fine. I'll post the results in a bit. Thanks for your assistance!

from gcs_signed_url.

mruoss avatar mruoss commented on May 28, 2024

Hi @camelpunch
Thanks for the issue, I was not aware of this deprecation. So I'm not currently working on it. If you wanna give it a go, be my guest! Otherwise I will take a look at it. Let me know.

from gcs_signed_url.

mruoss avatar mruoss commented on May 28, 2024

Actually, what makes you think the used api is the deprecated one? I'd have to give it a closer look but after looking at the request and response parameters just briefly, I tkink it's the correct one...

from gcs_signed_url.

camelpunch avatar camelpunch commented on May 28, 2024

This comment is what got me worried.

(see https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/signBlob)

However, this comment points to the new one:

https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/signBlob

The actual domain used seems to be content-iamcredentials.googleapis.com - whereas the docs say to use iamcredentials.googleapis.com (this could be deliberate - I don't know enough about this).

@endpoint "https://content-iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/"

from gcs_signed_url.

mruoss avatar mruoss commented on May 28, 2024

Fixed. Let me know if you need this released asap. Otherwise with the next release.

from gcs_signed_url.

camelpunch avatar camelpunch commented on May 28, 2024

Thanks! It's not urgent for me. I wanted to use this library's parts to sign a direct-upload form POST, but ran into issues with the SignBlob API. I can get an upload working with a static JSON key but the SignBlob API's signatures never match (tried with/without base64, and I am base16ing the signature afterwards).

If I figure it out I might PR form signing into this repo, if that makes sense? Kinda at odds with its name, though.

from gcs_signed_url.

mruoss avatar mruoss commented on May 28, 2024

We do that on a project. Let me know if you need help with it.

We do the same on a project and it works well. Let me know if you need help.

I can get an upload working with a static JSON key but the SignBlob API's signatures never match

Are you on the latest version? Does it have to do with #16?

Kinda at odds with its name, though.

Fair enough ;)

from gcs_signed_url.

camelpunch avatar camelpunch commented on May 28, 2024

@mruoss is there any chance I could see a working example of the SignBlob API being used to sign a form upload? I've recently revisited this and come up against the same issues. I tried using the official, generated, google API with the horrendous docs and get the same problems with mismatching sigs.

from gcs_signed_url.

camelpunch avatar camelpunch commented on May 28, 2024

My working version with on-premises signing is here: https://github.com/code-supply/code-supply/blob/d10d16df738a799d15b610eb2d7bcbf0e9aa8a0d/web/affable/lib/affable/uploads.ex#L8-L45

It integrates with the fancy LiveView uploads stuff, which needs a JS component: https://github.com/code-supply/code-supply/blob/d10d16df738a799d15b610eb2d7bcbf0e9aa8a0d/web/affable/assets/src/app.ts#L43-L67

from gcs_signed_url.

mruoss avatar mruoss commented on May 28, 2024

Not sure I understand. You have a working solution but you want to switch from on-prem signing to using the API?

from gcs_signed_url.

camelpunch avatar camelpunch commented on May 28, 2024

Apologies, I wasn't very clear. Yes! The links above point to working code using on-prem signing. I want to use the SignBlob API, but whenever I use it either from this library or from Google's SDK, I run into trouble.

The API returns a base64-encoded string, which differs to the result of the on-prem sign, which gives a non-UTF8 bytestring. This would be alright, but even when decoded, the bytes are wildly different from the result of the on-prem signing, and the body of the POST from the browser confirms this (SignatureDoesNotMatch).

When I recreate a failing case for the nth time I'll post it as a branch to that code.

from gcs_signed_url.

camelpunch avatar camelpunch commented on May 28, 2024

This is the new working code (missing error checking etc) with SignBlob: https://github.com/code-supply/code-supply/blob/ddcde9e69f5a7098beda4c403483180a261f6372/web/affable/lib/affable/uploads.ex#L33-L50

Thanks for your work!

from gcs_signed_url.

Related Issues (8)

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.