Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ For convenience:
* `hatch run lambda:prepare` will run steps 2-5 in a single command.
* `hatch run lambda:deploy-no-dnssec` or `hatch run lambda:deploy-dnssec` will clean the environment and then run steps 2-6 with DNSSEC validation enabled or disabled respectively.

Note: the above commands do not run `tofu init`. During first time environment setup this will need to be run in the `open-tofu` dir for these commands to work.

## Testing
The following is an example of a test API call that uses bash command substitution to fill in the proper values for the API URL and the API key.

Expand Down Expand Up @@ -93,7 +95,7 @@ If you would like to take the API down, run `tofu destroy` in the open-tofu dire

After `tofu destroy`, `./clean.sh` in the root directory also clears generated/zip files.


`hatch run lambda:destroy-tf` can be run as an alternative to `tofu destroy`

# Remaining tasks

Expand Down
1 change: 1 addition & 0 deletions open-tofu/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ classifiers = [
]
dependencies = [
# "open-mpic-core @ git+https://github.com/open-mpic/open-mpic-core-python.git@birgelee-key-auth-hash",
"pyyaml==6.0.1",
"pyyaml==6.0.2",
"requests>=2.32.3",
"dnspython==2.6.1",
"pydantic==2.8.2",
"aiohttp==3.11.11",
"aws-lambda-powertools[parser]==3.2.0",
"open-mpic-core==5.2.0",
"dnspython==2.7.0",
"pydantic==2.10.6",
"aiohttp==3.11.13",
"aws-lambda-powertools[parser]==3.8.0",
"open-mpic-core==5.5.1",
"aioboto3~=13.3.0",
"black==24.8.0",
]
Expand All @@ -56,7 +56,7 @@ Source = "https://github.com/open-mpic/aws-lambda-python"
#virtual = ".hatch"

[tool.api]
spec_version = "3.1.0"
spec_version = "3.3.0"
spec_repository = "https://github.com/open-mpic/open-mpic-specification"

[tool.hatch]
Expand Down Expand Up @@ -87,10 +87,10 @@ PIP_ONLY_BINARY = ":all:"
#PIP_TARGET = "layer/create_layer_virtualenv2/lib/python3.11/site-packages" # does not work... bug in pip 24.2?

[tool.hatch.envs.lambda.scripts]
layer-install = "pip install . --platform manylinux2014_aarch64 --only-binary=:all: --target layer/create_layer_virtualenv/lib/python3.11/site-packages"
layer-package = "sh ./package-layer.sh"
layer-install = "pip install . --upgrade --platform manylinux2014_aarch64 --only-binary=:all: --target layer/create_layer_virtualenv/lib/python3.11/site-packages"
layer-package = "./package-layer.sh"
configure-tf = "python configure.py"
zip-lambdas = "sh ./zip-all.sh"
zip-lambdas = "./zip-all.sh"
apply-tf-dnssec = "(cd open-tofu && tofu apply -var=\"dnssec_enabled=true\" -auto-approve)"
apply-tf-no-dnssec = "(cd open-tofu && tofu apply -var=\"dnssec_enabled=false\" -auto-approve)"
destroy-tf = "(cd open-tofu && tofu destroy -auto-approve)"
Expand All @@ -100,7 +100,7 @@ prepare = [
"configure-tf",
"zip-lambdas"
]
clean = "sh ./clean.sh"
clean = "./clean.sh"
deploy-dnssec = [
"clean",
"prepare",
Expand Down
2 changes: 1 addition & 1 deletion src/aws_lambda_mpic/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.1"
__version__ = "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from aws_lambda_powertools.utilities.parser import event_parser, envelopes

from open_mpic_core import MpicRequest, CheckRequest, CheckResponse
from open_mpic_core import MpicRequestValidationError, MpicRequestValidationMessages
from open_mpic_core import MpicRequestValidationException, MpicRequestValidationMessages
from open_mpic_core import MpicCoordinator, MpicCoordinatorConfiguration
from open_mpic_core import CheckType
from open_mpic_core import RemotePerspective
Expand Down Expand Up @@ -196,7 +196,7 @@ def build_400_response(error_name, issues_list):
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except MpicRequestValidationError as e:
except MpicRequestValidationException as e:
validation_issues = json.loads(e.__notes__[0])
return build_400_response(MpicRequestValidationMessages.REQUEST_VALIDATION_FAILED.key, validation_issues)
except ValidationError as validation_error:
Expand Down