Giter VIP home page Giter VIP logo

Comments (3)

andyrzhao avatar andyrzhao commented on June 14, 2024

Hi Tim, thank you for your suggestion! "oauth2l curl" was added mostly to simplify the syntax for invoking API calls, and I did not pay attention to the output (stderr vs stdout) when implementing it. In fact, I do not even remember why the built-in "print" was used over the fmt version - this is likely a mistake. Feel free to put up a PR to correct the channels - however, this would be considered a "breaking" change. We should document the change well, especially considering errors else-where are being written to stdout today - and it may be useful if you can provide a concrete example of how to take advantage of the updated channels. We could include the change in the next major release. Thanks!

from oauth2l.

timdp avatar timdp commented on June 14, 2024

I also thought it was a mistake, but I wanted to check first. Go stdio isn't that intuitive.

I was thinking the corrected behavior could be behind a flag, but that would complicate things. I would indeed rather just release this as a major version.

I'll see if I can come up with a PR!

from oauth2l.

timdp avatar timdp commented on June 14, 2024

If we're making a breaking change anyway, maybe it would make sense to make the oauth2l-curl combo look more like sudo?

That way, one could prefix any curl command (for a relevant URL) with oauth2l + its flags to authenticate it, without having to alter the unauthenticated command any further. For example:

oauth2l --scope cloud-platform \
  curl -fsSL https://cloudfunctions.googleapis.com/v2/...

It would probably also be trivial to get the same functionality in place for wget and httpie, to name but a few. Note that it wouldn't work for arbitrary commands (like sudo) because it does involve changing the wrapped command.

I imagine this would entail a more invasive change to the argument parser though.

from oauth2l.

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.