mapbox / mapbox/mapbox-navigation-android-examples

[Android Auto] Investigate how we need to handle trusted hosts

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

jira-sync-complete
Dominant language
Kotlin
Stars
65
Forks
56
Avg merge
1d 4h
Merged PRs (30d)
2

Description

@kmadsen commented on [Thu May 27 2021](https://github.com/mapbox/1tap-android/issues/988)

The car library has a [HostValidator](https://developer.android.com/reference/androidx/car/app/validation/HostValidator)

Which essentially makes the 1tap app a trusted host with the head unit. You can find where this is in the `MainCarAppService`. I don't fully understand either, so this ticket is to figure it out and share your findings.

``` kotlin
class MainCarAppService : CarAppService() {
override fun createHostValidator(): HostValidator {
return HostValidator.ALLOW_ALL_HOSTS_VALIDATOR
// TODO limit hosts for production
// https://github.com/mapbox/1tap-android/issues/988
// return HostValidator.Builder(this)
// .addAllowedHosts(R.array.android_auto_allow_list)
// .build()
}

override fun onCreateSession(): Session {
return MainCarSession()
}
}

```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MainCarAppService and the linked AndroidX HostValidator documentation, focusing on the current ALLOW_ALL_HOSTS_VALIDATOR configuration and the commented allow-list alternative. Document how trusted hosts should be handled for production and share the findings and recommendation in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile, security
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.