summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/oauth2/google/externalaccount/programmaticrefreshcredsource.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/oauth2/google/externalaccount/programmaticrefreshcredsource.go')
-rw-r--r--vendor/golang.org/x/oauth2/google/externalaccount/programmaticrefreshcredsource.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/golang.org/x/oauth2/google/externalaccount/programmaticrefreshcredsource.go b/vendor/golang.org/x/oauth2/google/externalaccount/programmaticrefreshcredsource.go
new file mode 100644
index 0000000..6c1abdf
--- /dev/null
+++ b/vendor/golang.org/x/oauth2/google/externalaccount/programmaticrefreshcredsource.go
@@ -0,0 +1,21 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package externalaccount
+
+import "context"
+
+type programmaticRefreshCredentialSource struct {
+ supplierOptions SupplierOptions
+ subjectTokenSupplier SubjectTokenSupplier
+ ctx context.Context
+}
+
+func (cs programmaticRefreshCredentialSource) credentialSourceType() string {
+ return "programmatic"
+}
+
+func (cs programmaticRefreshCredentialSource) subjectToken() (string, error) {
+ return cs.subjectTokenSupplier.SubjectToken(cs.ctx, cs.supplierOptions)
+}