-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The ability for oneshot to print/return information about the GET request (for oidc flows) #26
Comments
Not at all. I think of oneshot as not just a file transfer utility but also as a tool for developers to use in their workflows; makes sense to me to include this. I like the idea of exposing several parts of the incoming request; the entire query string, the url params, headers, etc... However, I'm not sure how the output should be formatted; I'm thinking adding a |
I think getting the info out at all was my first thought - and I hadn't really thought about the formatting. Agree with you that there are probably two use cases - one for users by default that just displays something friendly.. and a machine readable output for pipeline/workflows. I think that sounds sensible to me. |
If there is a flag that gets the entire incoming request structure to output as JSON - it is certainly trivial to process that with jq (etc) so that is a good solution for me |
Sorry for such a long delay in my response, but I've finally been able to dedicate some time to this project and have recently released a beta for v2 which I think more than solves this issue by providing rich JSON reports including stats and the requests of both unsuccessful and successful transfers. |
When doing development / debug / testing of oauth/openid flows - the interactive web browser portion finishes with a redirect to a URL that is meant to receive the authorisation code in a URL param (at which point it will go and do some code exchanges).
Scripting testing of this in something like bash is painful - but I think oneshot with very minimal additions could help out.
As a proof of concept - I used oneshot like this
and set up my oauth redirect to
http://127.0.0.1:8080
.I initiated my oauth flow in bash, launched a browser to do the login portion, and see that the page then redirects to oneshot with a GET of
http://127.0.0.1:8080?code=ABCDEFGH&state=XYZ
(i.e. the browser shows the output of the shell/CGI and then exits .. code=ABCDEFGH&state=XYZ)
However, I have no way of getting that information out of the invocation of oneshot in my bash script. I was thinking of a series of command line flags that would instruct oneshot to print this information on the end of the request.
So something like
--echo-from-client query_string
where the sky is the limit for what details of the client could be shown. I'd possibly start with any of the variables that are in the environment of the CGI launch.
So the expected invocation pattern would be
QUERY=$(oneshot -q -D -S 'echo "Thanks"' --echo-from-client query_string)
I realise this is a bit outside the box from what oneshot was intended for - but does fall into the category of things that I need a http server that only responds once for!
The text was updated successfully, but these errors were encountered: