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

Unable to configure API endpoint using command line tool #724

Closed
1ec5 opened this issue Aug 19, 2022 · 0 comments · Fixed by #728
Closed

Unable to configure API endpoint using command line tool #724

1ec5 opened this issue Aug 19, 2022 · 0 comments · Fixed by #728
Assignees
Labels
command line tool documentation op-ex Refactoring, Tech Debt or any other operational excellence work.

Comments

@1ec5
Copy link
Contributor

1ec5 commented Aug 19, 2022

The command line tool reads the access token from the MAPBOX_ACCESS_TOKEN environment variable, but an access token is only valid for a particular API endpoint. The tool should also read the API endpoint from the environment, defaulting to api.mapbox.com.

This code needs to pass the API endpoint into the Credentials(accessToken:host:) initializer:

let accessToken: String? =
ProcessInfo.processInfo.environment["MAPBOX_ACCESS_TOKEN"] ??
UserDefaults.standard.string(forKey: "MBXAccessToken")
let credentials = Credentials(accessToken: accessToken!)
private let directions = Directions(credentials: credentials)

While we’re at it, the MAPBOX_ACCESS_TOKEN environment variable isn’t documented in --help.

/cc @mapbox/navigation-ios @purew

@1ec5 1ec5 added documentation op-ex Refactoring, Tech Debt or any other operational excellence work. command line tool labels Aug 19, 2022
@1ec5 1ec5 linked a pull request Aug 20, 2022 that will close this issue
@1ec5 1ec5 self-assigned this Aug 22, 2022
@1ec5 1ec5 closed this as completed in #728 Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command line tool documentation op-ex Refactoring, Tech Debt or any other operational excellence work.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant