Skip to content

Commit f59154c

Browse files
committed
download the license when installing a driver if they don't already have it
1 parent 71ecfac commit f59154c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

auth/credentials.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ func UpdateCreds() error {
268268
})
269269
}
270270

271-
const licenseURI = "https://dbc-cf-api.columnar.workers.dev/trial_license"
271+
func IsColumnarPrivateRegistry(u *url.URL) bool {
272+
return u.Host == DefaultOauthURI
273+
}
274+
275+
const licenseURI = "https://heimdall.columnar.tech/trial_license"
272276

273277
func FetchColumnarLicense(cred *Credential) error {
274278
licensePath := filepath.Join(filepath.Dir(credPath), "columnar.lic")

drivers.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ func makereq(u string) (resp *http.Response, err error) {
164164
}
165165

166166
if cred != nil {
167+
if auth.IsColumnarPrivateRegistry(uri) {
168+
// if we're accessing the private registry then attempt to
169+
// fetch the trial license. This will be a no-op if they have
170+
// a license saved already, and if they haven't started their
171+
// trial, then this will silently fail.
172+
_ = auth.FetchColumnarLicense(cred)
173+
}
167174
req.Header.Set("Authorization", "Bearer "+cred.GetAuthToken())
168175
}
169176

0 commit comments

Comments
 (0)