external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

Allow for User API tokens to be used with DNSimple

Open IntegralProgrammer opened this issue 1 year ago • 6 comments

Description

This Pull Request introduces the following environment variables for overriding data retrieved from the DNSimple API. This is needed when using User API DNSimple tokens (as opposed to Account API DNSimple tokens) as this data cannot be accessed with a User API token:

  • DNSIMPLE_ACCOUNT_ID: The DNSimple account which owns the DNS records to be updated
  • DNSIMPLE_ZONES: A comma separated list of DNS Zones in DNSimple which External-DNS will be allowed to manipulate

Fixes #4273

Checklist

  • [x] Unit tests updated
  • [x] End user documentation updated

IntegralProgrammer avatar Feb 21 '24 20:02 IntegralProgrammer

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: IntegralProgrammer / name: Michael Lescisin (660b20b4425da537b324f65c627b0483ea3319d0, d475eb65576291ec9b1e35bec0a3e5c4dd198914, 9b3c2857767b1f245fb4d886cfa38f987d328e1f, 26694e4b2669e8f7baa29366a0455c362ae660c1, acf188f7199dab55538aa8465cedaa188df90ada, d0c121b97cb7da27e07404ef16e04ca776d23549, ea2d25948531da2e9c5a8c6af19016e4e047f247, 3babcbcd72360470b423a22033c8c6f75d9dcbda, 9c24ecc1084c4eff695da14e1e6b1ef1b9202b77, 3eb852fe2acda27f3bf15f75908de2ba966faa34, c54a9a8df2e806f11441ce72820cdb978be3d97c, 487501d923a59cb9e93ec3ebf4ef5447476540a7, eb59b9bd4d6eca06759540e6758540a46fd9b441, ed3efdb2608af0c387bba69ad6440e4f3f2c5c30)

Welcome @IntegralProgrammer!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Feb 21 '24 20:02 k8s-ci-robot

Hi @IntegralProgrammer. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Feb 21 '24 20:02 k8s-ci-robot

@IntegralProgrammer every feature requires a test.

szuecs avatar Feb 23 '24 12:02 szuecs

@IntegralProgrammer every feature requires a test.

Thank you for your feedback - I have added tests for this new feature in provider/dnsimple/dnsimple_test.go and have updated the documentation in docs/tutorials/dnsimple.md.

IntegralProgrammer avatar Feb 26 '24 19:02 IntegralProgrammer

/ok-to-test

mloiseleur avatar Mar 04 '24 07:03 mloiseleur

@IntegralProgrammer Thanks. Now you need to fix what is required by the linter. you can test it locally with make lint

mloiseleur avatar Mar 12 '24 15:03 mloiseleur

/retitle feat(DNSimple): User API tokens

mloiseleur avatar Mar 12 '24 15:03 mloiseleur

See my last suggestion about dnsimpleAccountId + Wdyt about keeping only NewDnsimpleProvider func without adding BuildDnsimpleProvider ?

I've removed the need for the dnsimpleAccountId variable in commit https://github.com/kubernetes-sigs/external-dns/pull/4274/commits/487501d923a59cb9e93ec3ebf4ef5447476540a7 and have refactored the code in dnsimple_test.go using a type assertion so that BuildDnsimpleProvider is no longer needed - https://github.com/kubernetes-sigs/external-dns/pull/4274/commits/ed3efdb2608af0c387bba69ad6440e4f3f2c5c30

IntegralProgrammer avatar Mar 15 '24 23:03 IntegralProgrammer

/lgtm

mloiseleur avatar Mar 16 '24 07:03 mloiseleur

/approve

szuecs avatar Apr 25 '24 14:04 szuecs

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: szuecs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Apr 25 '24 14:04 k8s-ci-robot