From 0db521a2812f016e7c54a018bde24a00f3a7d25a Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 18 Oct 2017 08:56:15 -0700 Subject: [PATCH] svchost/auth: expose a "NoCredentials" credentials source For situations where no credentials are needed but where a working CredentialsSource is still required, this variable provides a convenient way to get a fully-functional-but-empty credentials source. --- svchost/auth/credentials.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/svchost/auth/credentials.go b/svchost/auth/credentials.go index 9eafdd93e..0bc6db4f1 100644 --- a/svchost/auth/credentials.go +++ b/svchost/auth/credentials.go @@ -16,6 +16,10 @@ import ( // there is no good reason to do so. type Credentials []CredentialsSource +// NoCredentials is an empty CredentialsSource that always returns nil +// when asked for credentials. +var NoCredentials CredentialsSource = Credentials{} + // A CredentialsSource is an object that may be able to provide credentials // for a given host. //