feat: add meta-auth (#4)
All checks were successful
continuous-integration/drone/push Build is passing

Co-authored-by: William Luke <williamluke4@gmail.com>
Reviewed-on: #4
Co-authored-by: williamluke <williamluke4@gmail.com>
Co-committed-by: williamluke <williamluke4@gmail.com>
This commit was merged in pull request #4.
This commit is contained in:
2022-07-04 10:37:40 +00:00
parent c3e5ee3199
commit bfe7086178
10 changed files with 640 additions and 507 deletions

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)