internal/access: add helper functions for testing authentication
internal/access: add helper functions for testing authentication

This change adds functions which assists in the testing of authentication.

Updates golang/go#48729

Change-Id: Ibff9c758e97c5fd3584c6e68612e4d9db99baa5e
Reviewed-on: https://go-review.googlesource.com/c/build/+/371396
Trust: Carlos Amedee <ab5e2bca84933118bbc9d48ffaccce3bac4eeb64@golang.org>
Run-TryBot: Carlos Amedee <ab5e2bca84933118bbc9d48ffaccce3bac4eeb64@golang.org>
Reviewed-by: Dmitri Shuralyov <d181b7fea0ec87c86ba5a890ab716db52498e3ba@golang.org>
TryBot-Result: Gopher Robot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

golang/build,golang/build,golang/build,golang/build