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

feat: add accounts python file #3

Closed
wants to merge 106 commits into from
Closed

feat: add accounts python file #3

wants to merge 106 commits into from

Conversation

johnson2427
Copy link
Collaborator

What I did

Adding aws kms interface capability

fixes: #

How I did it

boto3 API calls

How to verify it

TBD

Checklist

  • Passes all linting checks (pre-commit and CI jobs)
  • New test cases have been added and are passing
  • Documentation has been updated
  • PR title follows Conventional Commit standard (will be automatically included in the changelog)

johnson2427 and others added 3 commits January 6, 2022 13:49
Added functionality for creating Eth Node for AWS in scratch folder.
Also grabbed aws-kms-ethereum-accounts code and placed it in scratch folder.
Have to add to Ape structured cli architecture.
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/utils.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
ape_aws_kms/utils.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
@johnson2427
Copy link
Collaborator Author

The message is DER encoded. From the looks of it, the first value of the signature is a standard (48, sometimes other values), and the second tells you how many characters define the signature. This value can change.

AWS uses asn1 tools to compile the information given to the signer, then decodes with that.

ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/accounts.py Outdated Show resolved Hide resolved
ape_aws_kms/utils.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/kms/_cli.py Outdated Show resolved Hide resolved
ape_aws/kms/_cli.py Outdated Show resolved Hide resolved
ape_aws/kms/_cli.py Outdated Show resolved Hide resolved
ape_aws/kms/_cli.py Outdated Show resolved Hide resolved
ape_aws/providers.py Outdated Show resolved Hide resolved
ape_aws/utils.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/utils.py Outdated Show resolved Hide resolved
ape_aws/utils.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/admin/_cli.py Outdated Show resolved Hide resolved
ape_aws/utils.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/utils.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/utils.py Outdated Show resolved Hide resolved
ape_aws/kms/_cli.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
@fubuloubu
Copy link
Member

Actually kinda of a neat find, you can use this to "type check" your dicts and kwargs (and some values) with boto usage: https://pypi.org/project/boto3-stubs/

Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting very close!

ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/kms/_cli.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
ape_aws/client.py Outdated Show resolved Hide resolved
@fubuloubu
Copy link
Member

Be nice to add a few tests for signing, then add py 3.10 and 3.11 (3.12 if it's easy)

You can drop 3.8 if you want, Ape v0.8 is gonna get rid of it and it doesn't matter for use with Silverback anyways (3.9 for that matter too)

ape_aws/utils.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the transaction tests

setup.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
tests/test_accounts.py Outdated Show resolved Hide resolved
tests/test_accounts.py Outdated Show resolved Hide resolved
tests/test_accounts.py Outdated Show resolved Hide resolved
ape_aws/kms/_cli.py Outdated Show resolved Hide resolved
ape_aws/kms/_cli.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
ape_aws/accounts.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants