-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Added Azion DNS API #3551
Conversation
please check this 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? |
dnsapi/dns_azion.sh
Outdated
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)}" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
dnsapi/dns_azion.sh
Outdated
|
||
AZION_Username="${AZION_Username:-$(_readaccountconf_mutable AZION_Username)}" | ||
AZION_Password="${AZION_Password:-$(_readaccountconf_mutable AZION_Password)}" | ||
AZION_Token="${AZION_Token:-$(_readaccountconf_mutable AZION_Token)}" |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
dnsapi/dns_azion.sh
Outdated
} | ||
|
||
_get_token() { | ||
AZION_Username="${AZION_Username:-$(_readaccountconf_mutable AZION_Username)}" |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
dnsapi/dns_azion.sh
Outdated
} | ||
|
||
_get_token() { | ||
AZION_Username="${AZION_Username:-$(_readaccountconf_mutable AZION_Username)}" |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
dnsapi/dns_azion.sh
Outdated
fi | ||
|
||
if _contains "$response" "\"entry\":\"$_record\""; then | ||
_json_record=$(echo "$response" | tr '{}' "\n" | grep "\"entry\":\"$_record\"") |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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.
Add Azion DNS API.
Issue to reports bugs/improvements #3555