iits-consulting / otc-auth

Open Source CLI for the Open Telekom Cloud written in go.
GNU General Public License v3.0
44 stars 5 forks source link

add support for `eu-ch2` region in IAM `endpoints.go` #77

Closed dombisza closed 10 months ago

dombisza commented 11 months ago

hello there,

eu-ch2 aka swisscloud uses a different API endpoint naming convention, I have updated common/endpoints/endpoints.go to support swisscloud IAM endpoint. Ran go fmt and tested auth on eu-de and on eu-ch2 as well. Not sure if there is any test suites I should be using when contributing to your project, if I missed it, please point me to the direction thanks!

./otc-auth login iam --os-username $MYUSER --os-password $MYPW --os-domain-name $MYDOMAIN --region eu-ch2             
2023/12/19 15:34:10 info: cloud REDACTED loaded successfully and set to active.
2023/12/19 15:34:10 info: retrieving unscoped token for active cloud...
2023/12/19 15:34:11 info: fetching projects for cloud REDACTED
2023/12/19 15:34:13 info: projects for active cloud:
REDACTED
REDACTED
REDACTED
2023/12/19 15:34:27 info: scoped token acquired successfully
2023/12/19 15:34:27 info: successfully obtained unscoped token!
Ninja243 commented 10 months ago

Thanks for the PR! I'd be happy to merge this as soon as the issue found by our linter is fixed!

dombisza commented 10 months ago

@Ninja243 thanks for the hint, fixed the return