feat: add meta-auth #4

Merged
williamluke merged 2 commits from feat/meta-auth into master 2022-07-04 12:37:41 +02:00
10 changed files with 759 additions and 461 deletions
Showing only changes of commit 4506cf5ad9 - Show all commits

View File

@ -59,7 +59,7 @@ confidence=
#
# Kubeflow disables string-interpolation because we are starting to use f
# style strings
disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,missing-docstring,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,relative-import,invalid-name,bad-continuation,no-member,locally-disabled,fixme,import-error,too-many-locals,no-name-in-module,too-many-instance-attributes,no-self-use,logging-fstring-interpolation
disable=old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,missing-docstring,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,relative-import,invalid-name,bad-continuation,no-member,locally-disabled,fixme,import-error,too-many-locals,no-name-in-module,too-many-instance-attributes,no-self-use,logging-fstring-interpolation
[REPORTS]

View File

@ -10,7 +10,7 @@ registry_address = 0xcf60ebc445b636a5ab787f9e8bc465a2a3ef8299
[meta]
url = http://localhost:63380
http_origin =
auth_token =
[rpc]
provider = http://localhost:63545

View File

@ -10,6 +10,7 @@ registry_address = 0xcf60ebc445b636a5ab787f9e8bc465a2a3ef8299
[meta]
url = http://localhost:8000
http_origin =
auth_token =
[rpc]
provider = http://localhost:8545

View File

@ -10,6 +10,7 @@ registry_address = 0xe3e3431BF25b06166513019Ed7B21598D27d05dC
[meta]
url = https://meta.sarafu.network
http_origin =
auth_token =
[rpc]
provider = https://rpc.sarafu.network

View File

@ -10,7 +10,7 @@ registry_address = 0x47269C43e4aCcA5CFd09CB4778553B2F69963303
[meta]
url = https://meta.sarafu.network
http_origin =
auth_token =
[rpc]
provider = https://rpc.sarafu.network

View File

@ -4,8 +4,12 @@ import logging
import os
from typing import List
# External imports
from chainlib.chain import ChainSpec
from chainlib.cli.config import Config
from cic_types.ext.metadata import MetadataRequestsHandler
from cic_types.ext.metadata.signer import Signer as MetadataSigner
# Local Modules
from cic.contract.components.attachment import Attachment
from cic.contract.components.meta import Meta
@ -15,9 +19,7 @@ from cic.contract.helpers import init_writers_from_config
from cic.contract.network import Network
from cic.contract.processor import ContractProcessor
from cic.writers import HTTPWriter, KeyedWriterFactory, MetadataWriter
# external imports
from cic_types.ext.metadata import MetadataRequestsHandler
from cic_types.ext.metadata.signer import Signer as MetadataSigner
log = logging.getLogger(__name__)
@ -146,9 +148,12 @@ def deploy_contract(
output_writer_path_meta = output_directory
metadata_endpoint = config.get("META_URL")
metadata_auth_token = config.get("META_AUTH_TOKEN")
if metadata_endpoint is not None:
MetadataRequestsHandler.base_url = metadata_endpoint
MetadataRequestsHandler.auth_token = metadata_auth_token
MetadataSigner.gpg_path = "/tmp"
MetadataSigner.key_file_path = config.get("AUTH_KEYFILE_PATH")
MetadataSigner.gpg_passphrase = config.get("AUTH_PASSPHRASE")

View File

@ -10,7 +10,7 @@ registry_address = 0xe3e3431BF25b06166513019Ed7B21598D27d05dC
[meta]
url = https://meta.sarafu.network
http_origin =
auth_token =
[auth]
type = gnupg
keyfile_path =

View File

@ -90,7 +90,6 @@ def main():
except Exception as e:
logg.exception(e)
sys.stderr.write("\033[;91m" + str(e) + "\033[;39m\n")
argparser.print_help()
sys.exit(1)

1191
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -32,12 +32,13 @@ cic = 'cic.runnable.cic_cmd:main'
[[tool.poetry.source]]
name = "grassroots_"
url = "https://pip.grassrootseconomics.net/"
default = true
secondary = true
[[tool.poetry.source]]
name = "pypi_"
url = "https://pypi.org/simple/"
secondary = true
default = true
[tool.poetry.dependencies]
python = "^3.8"
@ -64,6 +65,7 @@ black = { version = "^22.1.0", allow-prereleases = true }
eth_tester = "0.5.0b3"
py-evm = "0.3.0a20"
rlp = "2.0.1"
mypy = "^0.961"
[tool.poetry.extras]
eth = [
@ -93,4 +95,3 @@ build_command = "pip install poetry && poetry build"
hvcs = "gitea"
hvcs_domain = "git.grassecon.net"
check_build_status = false