Skip to content

Commit

Permalink
Merge pull request #1 from cgill27/master
Browse files Browse the repository at this point in the history
Fixing IAM policy so it will validate properly in IAM polices
  • Loading branch information
mindstorms6 authored Feb 20, 2017
2 parents 80b491d + f9cb280 commit 6f4292e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
11 changes: 6 additions & 5 deletions letsencrypt_route53/authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

logger = logging.getLogger(__name__)


class Authenticator(common.Plugin):
zope.interface.implements(interfaces.IAuthenticator)
zope.interface.classProvides(interfaces.IPluginFactory)
Expand All @@ -32,7 +33,7 @@ def prepare(self): # pylint: disable=missing-docstring,no-self-use
pass # pragma: no cover

def more_info(self): # pylint: disable=missing-docstring,no-self-use
return ("")
return ""

def get_chall_pref(self, domain):
# pylint: disable=missing-docstring,no-self-use,unused-argument
Expand All @@ -50,14 +51,14 @@ def _perform_single(self, achall):
r53 = boto3.client('route53')
logger.info("Doing validation for " + response.domain)
listResponse = r53.list_hosted_zones_by_name(DNSName=response.domain)
matches = listResponse.HostedZones;
matches = listResponse.HostedZones
if matches.size != 0:
logger.error("Route53 returned " + mathces.size + " matching hosted zones. Expected exactly one. Auth canceled.")
logger.error("Route53 returned " + matches.size + " matching hosted zones. Expected exactly one. Auth canceled.")
return None
else:
r53.change_resource_record_sets(HostedZoneId=matches[0].Id,
ChangeBatch={
'Comment': 'Let\'s Entcrypt Change',
'Comment': 'Let\'s Encrypt Change',
'Changes': [
{
'Action': 'UPSERT',
Expand Down Expand Up @@ -86,7 +87,7 @@ def _perform_single(self, achall):

def cleanup(self, achalls):
# pylint: disable=missing-docstring,no-self-use,unused-argument
#TODO:Cleanup record 
# TODO:Cleanup record 
r53 = boto3.client('route53')
#for achall in achalls:
# r53.delete_object(Bucket=self.conf('s3-bucket'), Key=achall.chall.path[1:])
Expand Down
3 changes: 1 addition & 2 deletions sample-aws-policy.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"Version": "2012-10-17",
"Id": "letsencrypt-route53 sample policy",
"Statement": [
{
"Effect": "Allow",
Expand All @@ -17,7 +16,7 @@
"Effect": "Allow",
"Action": [
"route53:List*",
"route53:Get*",
"route53:Get*"
],
"Resource": [
"*"
Expand Down

0 comments on commit 6f4292e

Please sign in to comment.