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

Added Azion DNS API #3551

Merged
merged 5 commits into from
Jun 24, 2021
Merged

Added Azion DNS API #3551

merged 5 commits into from
Jun 24, 2021

Conversation

marcusgrando
Copy link
Contributor

@marcusgrando marcusgrando commented Jun 11, 2021

Add Azion DNS API.

Issue to reports bugs/improvements #3555

@Neilpang
Copy link
Member

@marcusgrando
Copy link
Contributor Author

please check this guide.
https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide

@Neilpang I've created Issue and added on Wiki page. As I know, was only two steps I left behind. If no, can you be more specific?

AZION_Username="${AZION_Username:-$(_readaccountconf_mutable AZION_Username)}"
AZION_Password="${AZION_Password:-$(_readaccountconf_mutable AZION_Password)}"
AZION_Token="${AZION_Token:-$(_readaccountconf_mutable AZION_Token)}"
AZION_ZoneID="${AZION_ZoneID:-$(_readaccountconf_mutable AZION_ZoneID)}"
Copy link
Member

Choose a reason for hiding this comment

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

please remove the "AZION_ZoneID", we should not need it.
And we can not save it in the account conf.

The user may issue certs for different zones everytime.

we should get the zone id by REST api every time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed


AZION_Username="${AZION_Username:-$(_readaccountconf_mutable AZION_Username)}"
AZION_Password="${AZION_Password:-$(_readaccountconf_mutable AZION_Password)}"
AZION_Token="${AZION_Token:-$(_readaccountconf_mutable AZION_Token)}"
Copy link
Member

Choose a reason for hiding this comment

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

how does the "AZION_Token" work?
Can we get it everytime or can we save it for future use? How long will it be valid? Is it valid forever ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simplified code about Token. You are right, token expires and it can't be save.

}

_get_token() {
AZION_Username="${AZION_Username:-$(_readaccountconf_mutable AZION_Username)}"
Copy link
Member

Choose a reason for hiding this comment

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

do you think it's better to use a name like: AZION_Email instead of AZION_Username ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, make sense. Updated and running tests again.

}

_get_token() {
AZION_Username="${AZION_Username:-$(_readaccountconf_mutable AZION_Username)}"
Copy link
Member

Choose a reason for hiding this comment

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

do you think it's better to use a name like: AZION_Email instead of AZION_Username ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, make sense. Updated and running tests again.

fi

if _contains "$response" "\"entry\":\"$_record\""; then
_json_record=$(echo "$response" | tr '{}' "\n" | grep "\"entry\":\"$_record\"")
Copy link
Member

Choose a reason for hiding this comment

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

please use double \n here:

tr '{}' "\n\n"

Copy link
Contributor Author

@marcusgrando marcusgrando Jun 23, 2021

Choose a reason for hiding this comment

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

Hi @Neilpang, shellcheck doesn't like this:

In dnsapi/dns_azion.sh line 131:
    _json_record=$(echo "$response" | tr '{}' "\n\n" | grep "\"entry\":\"$_record\"")
                                              ^----^ SC2020: tr replaces sets of chars, not words (mentioned due to duplicates).

For more information:
  https://www.shellcheck.net/wiki/SC2020

Instead I changed to only one bracket. Running tests right now.

@Neilpang Neilpang merged commit 5153952 into acmesh-official:dev Jun 24, 2021
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.

4 participants