open-mpic / aws-lambda-python

An implementation of the Open MPIC API using AWS-Lambda serverless fucntions written in Python as well as AWS API Gateway.
MIT License
6 stars 1 forks source link

validation-method is dns-generic. #2

Closed huytn closed 1 month ago

huytn commented 1 month ago

https://github.com/open-mpic/open-mpic-specification/blob/b04af663e493300cad8dab61400d6bd56ac69129/openapi.yaml#L244

https://github.com/open-mpic/aws-lambda-python/blob/fd5c4d4e8fb62e24cf269697f9f7d4d1c8a9d51a/lambda_validator/lambda_function.py#L54

I found an issue, as spec describes it should be:

name_to_resolve = f'{challenge_prefix}.{identifier}' if len(challenge_prefix) > 0 else f'{identifier}.'

And controller function could not handle error response.

Screenshot 2024-07-19 at 14 27 25
birgelee commented 1 month ago

I pushed a fix for this in 3ecfa02

I used the line you proposed with a small change: I removed the trailing .

so else f'{identifier}.' -> else f'{identifier}'

This was for consistency because none of the other identifier values have a trailing . added when passed to the DNS library. If there is a reason to add the trailing dot here or elsewhere, let me know.

birgelee commented 1 month ago

Also, controller currently does not have proper error handling for errors originated by remote perspectives. Thus, any error generated by a remote perspective will propagate up and cause a 500 Internal Server Error. This will be fixed shortly.