Comments (8)
For anyone that will need this:
curl -d "password=secret&ttl=day" -X POST https://snappass.herokuapp.com | grep "value" | awk -F '"' '{print $8}'
from snappass.
thanks @wooyek , based on your comment I converted to PowerShell for the system admins out there:
$Password = 'something1122'
$RawPasswordLink = Invoke-WebRequest -Method POST -Body "password=$Password&ttl=day" -Uri https://snappass.herokuapp.com/ -UseBasicParsing
$Link = $RawPasswordLink.RawContent.Substring($RawPasswordLink.RawContent.IndexOf('value="') + 7)
$Link = $Link.Substring(0, $link.IndexOf(' ') - 1)
$Link
from snappass.
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
}
from snappass.
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 =)
from snappass.
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:
- curl
- slack
- web
- ios
- android
from snappass.
Just pushed PR #51 to accomplish this.
from snappass.
For anyone that will need this:
curl -d "password=secret&ttl=day" -X POST https://snappass.herokuapp.com[](https://snappass.herokuapp.com) | grep "value" | awk -F '"' '{print $8}'
is there a way to pull the secret content using a curl command and the generated URL?
from snappass.
I've created a PR that adds a /api endpoint that might facilitate this:
from snappass.
Related Issues (20)
- QOL changes HOT 4
- Secret creation non public? HOT 1
- Migrate to fakeredis for tests HOT 1
- Where to host this HOT 1
- Use of SECRET_KEY HOT 2
- .NET port
- How secure is the docker-compose approach? HOT 2
- feature request: i18n HOT 3
- URL_PREFIX is ignored HOT 3
- feature request: Prevent crawler from opening / invalidate secret HOT 2
- Simple setup question HOT 1
- Snappass config for apache webserver
- docker hub 404 HOT 1
- Stack Error when trying to start SnapPass HOT 3
- Official method of securing this with HTTPS? HOT 2
- Question about creation of multiple links HOT 6
- Any way to change the URL of the links that the Docker Container SnapPass spits out? HOT 7
- New release?
- Upgrade to JQuery version HOT 2
- Docker Build not working anymore HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snappass.