(ctx, key)
Print api key details to stdout.
Print api key details to stdout.
Print api key details to stdout .
def show_api_key_details(ctx, key):
    """Print api key details to stdout."""
    db = configure_db("rw")
    with db_worker_session(db) as session:
        row = session.query(ApiKey).filter(ApiKey.valid_key == key).one_or_none()
        if row:
            api_key = Key.from_obj(row)
        else:
            api_key = None

    if api_key:
        table = [[name, value] for name, value in api_key.as_dict().items()]
        print_table(table, delimiter=" : ", stream_write=click_echo_no_nl)
    else:
        click.echo(f"API key '{key}' does not exist")
def show_api_key_details ( ctx , key ) : db = configure_db ( "rw" ) with db_worker_session ( db ) as session : row = session . query ( ApiKey ) . filter ( ApiKey . valid_key == key ) . one_or_none ( ) if row : api_key = Key . from_obj ( row ) else : api_key = None if api_key : table = [ [ name , value ] for name , value in api_key . as_dict ( ) . items ( ) ] print_table ( table , delimiter = " : " , stream_write = click_echo_no_nl ) else : click . echo ( f"API key '{key}' does not exist" )