Skip to content

Commit

Permalink
Add arguments to sign/verify commands
Browse files Browse the repository at this point in the history
  • Loading branch information
di committed Apr 6, 2022
1 parent 6515c29 commit d62ef4e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
14 changes: 3 additions & 11 deletions sigstore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
The `sigstore` APIs.
"""

from sigstore._sign import sign
from sigstore._verify import verify
from sigstore._version import __version__

__all__ = ["__version__"]


def sign():
"""Public API for signing blobs"""
return "Nothing here yet"


def verify():
"""Public API for verifying blob signatures"""
return "Nothing here yet"
__all__ = ["__version__", "sign", "verify"]
19 changes: 15 additions & 4 deletions sigstore/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@ def main():


@main.command("sign")
def _sign():
click.echo(sign())
@click.option("identity_token", "--identity-token", type=click.STRING)
@click.argument("file_", metavar="FILE", type=click.File("r"), required=True)
def _sign(file_, identity_token):
click.echo(sign(file_=file_, identity_token=identity_token, output=click.echo))


@main.command("verify")
def _verify():
click.echo(verify())
@click.option("certificate_path", "--cert", type=click.Path())
@click.option("signature_path", "--signature", type=click.Path())
@click.argument("file_", metavar="FILE", type=click.File("r"), required=True)
def _verify(file_, certificate_path, signature_path):
click.echo(
verify(
filename=file_.name,
certificate_path=certificate_path,
signature_path=signature_path,
)
)

0 comments on commit d62ef4e

Please sign in to comment.