GithubHelp home page GithubHelp logo

Comments (8)

wooyek avatar wooyek commented on June 18, 2024 3

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.

Kav7 avatar Kav7 commented on June 18, 2024 1

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.

silverl avatar silverl commented on June 18, 2024 1

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.

jameswthorne avatar jameswthorne commented on June 18, 2024

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.

nichochar avatar nichochar commented on June 18, 2024

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.

jameswthorne avatar jameswthorne commented on June 18, 2024

Just pushed PR #51 to accomplish this.

from snappass.

yuval-katzman-digsec avatar yuval-katzman-digsec commented on June 18, 2024

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.

reinoud avatar reinoud commented on June 18, 2024

I've created a PR that adds a /api endpoint that might facilitate this:

from snappass.

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.