-
Notifications
You must be signed in to change notification settings - Fork 247
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
Make possible to get the password via Curl #36
Comments
I'm been maintaining my own fork of snappass that includes an API. I'm working on rebasing all of my changes on top of the latest changes in pinterest/snappass. Stay tuned =) |
It would be very nice tom separate the code out and have an API and a default web client. This way we could start building multiple clients, like:
|
Just pushed PR #51 to accomplish this. |
For anyone that will need this:
|
thanks @wooyek , based on your comment I converted to PowerShell for the system admins out there:
|
Here's my PowerShell function taking advantage of the recent addition of JSON support. function Get-OneTimeUsePasswordLink {
param
(
[String] $password,
[ValidateSet("Week", "Day", "Hour")]
[String]
$ttl
)
$postParams = @{password = $password; ttl = $ttl }
$response = Invoke-WebRequest -Uri "https://your.site.here" -Method Post -ContentType "application/x-www-form-urlencoded" -Body $postParams -Headers @{"accept"="application/json"}
$json = $response | ConvertFrom-Json
return $json.Link
} |
is there a way to pull the secret content using a curl command and the generated URL? |
I've created a PR that adds a /api endpoint that might facilitate this: |
Hey, do you know what the TTL parameter is for 2 weeks expiry? |
Looks like it's "Two Weeks". I checked the code. |
Here's the PowerShell function rewritten to use the new API:
|
Amazing thank you! |
Feature Request:
"With the secured link, make possible to retrieve raw password via a simple Linux curl command"
The text was updated successfully, but these errors were encountered: