Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New CLI version #125

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
pm-v2: fix apis
Rolaman committed Dec 21, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e52af8b64289298225acbb4bc8830e0666479fa9
2 changes: 1 addition & 1 deletion scripts/auth_tools.py
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ def read_credentials_file(file_name: str) -> str:

def update_auth(auth):

url = URL + "_open/auth"
url = URL + "/user/signin"
body = {"username": user, "password": secret}

response = requests.post(url, json=body)
2 changes: 1 addition & 1 deletion scripts/request_tools.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ def push(auth, key, file, cost, subkey=None, verbose=False):
data["statement_subkey"] = subkey

headers = get_headers(auth)
url = URL + f"_db/{DB_NAME}/{MOUNT}/request/"
url = URL + "/request"
res = requests.post(url=url, json=data, headers=headers)
if res.status_code != 200:
logging.error(f"Error: {res.status_code} {res.text}")
5 changes: 2 additions & 3 deletions scripts/signup.py
Original file line number Diff line number Diff line change
@@ -3,9 +3,8 @@
import requests
from auth_tools import get_headers, create_credentials_file


def signup(user, password, email):
url = URL + f"_db/{DB_NAME}/{MOUNT}/user/signup"
url = URL + f"/user/signup"
body = {
"user": user,
"passwd": password,
@@ -22,7 +21,7 @@ def signup(user, password, email):

def register_producer(description, url, logo, eth_address):
headers = get_headers(None)
url = URL + f"_db/{DB_NAME}/{MOUNT}/producer/register"
url = URL + "/producer"
body = {"description": description}
if url is not None:
body["url"] = url
4 changes: 2 additions & 2 deletions scripts/statement_tools.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ def push(auth, file):
return

headers = get_headers(auth)
url = URL + f"_db/{DB_NAME}/{MOUNT}/statement/"
url = URL + "/statement"
res = requests.post(url=url, json=data, headers=headers)
if res.status_code != 200:
logging.error(f"Error: {res.status_code} {res.text}")
@@ -31,7 +31,7 @@ def push_parser(args):

def get(auth, key, output):
headers = get_headers(auth)
url = URL + f"_db/{DB_NAME}/{MOUNT}/statement/"
url = URL + "/statement"
if key:
url += key
res = requests.get(url=url, headers=headers)