sera/commands/create.py
def signature(ctx):
    """Create a signature to validate watchers"""
    if ctx.parent.parent.params['watcher']:
        click.echo("This command runs locally")
        raise click.Abort
    # Generate a new random signing key
    signing_key = signing.SigningKey.generate()
    signing_key_b64 = signing_key.encode(encoder=URLSafeBase64Encoder)
    verify_key = signing_key.verify_key
    verify_key_b64 = verify_key.encode(encoder=URLSafeBase64Encoder)
    set_env_key(ctx.obj['env_path'], 'SERA_SIGNATURE', signing_key_b64.decode())
    set_env_key(ctx.obj['env_path'], 'SERA_VERIFY_KEY', verify_key_b64.decode())
    if ctx.obj['verbosity']:
        click.echo('SERA_SIGNATURE and SERA_VERIFY_KEY written to %s' % ctx.obj['env_path'])
Create a signature to validate watchers
Create a signature to validate watchers
Create a signature to validate watchers
def signature(ctx):
    if ctx.parent.parent.params['watcher']:
        click.echo("This command runs locally")
        raise click.Abort
    signing_key = signing.SigningKey.generate()
    signing_key_b64 = signing_key.encode(encoder=URLSafeBase64Encoder)
    verify_key = signing_key.verify_key
    verify_key_b64 = verify_key.encode(encoder=URLSafeBase64Encoder)
    set_env_key(ctx.obj['env_path'], 'SERA_SIGNATURE', signing_key_b64.decode())
    set_env_key(ctx.obj['env_path'], 'SERA_VERIFY_KEY', verify_key_b64.decode())
    if ctx.obj['verbosity']:
        click.echo('SERA_SIGNATURE and SERA_VERIFY_KEY written to %s' % ctx.obj['env_path'])
def signature ( ctx ) : if ctx . parent . parent . params [ 'watcher' ] : click . echo ( "This command runs locally" ) raise click . Abort signing_key = signing . SigningKey . generate ( ) signing_key_b64 = signing_key . encode ( encoder = URLSafeBase64Encoder ) verify_key = signing_key . verify_key verify_key_b64 = verify_key . encode ( encoder = URLSafeBase64Encoder ) set_env_key ( ctx . obj [ 'env_path' ] , 'SERA_SIGNATURE' , signing_key_b64 . decode ( ) ) set_env_key ( ctx . obj [ 'env_path' ] , 'SERA_VERIFY_KEY' , verify_key_b64 . decode ( ) ) if ctx . obj [ 'verbosity' ] : click . echo ( 'SERA_SIGNATURE and SERA_VERIFY_KEY written to %s' % ctx . obj [ 'env_path' ] )
Create a signature to validate watchers
Create a signature to validate watchers
"""Create a signature to validate watchers""" # Generate a new random signing key
ctx