- Notifications
You must be signed in to change notification settings - Fork927
feat(coderd): connect dbcrypt package implementation#9523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
fb953e4
3b8140b
55b93e7
f340cba
feae634
381f078
c42e6a6
6a50a43
46b1ff4
9c18168
6c28ce5
c54b64a
5959b34
b1546b1
3859e03
a4f93c5
55a0fd0
cce0244
d51ec66
aa39fcc
e69e3ef
ebf4eef
2de6cc3
7774811
35ca78f
3a92a7d
8b1f43c
270cdc1
2514ffe
cd351af
2f5c112
2450d13
e56b639
441fcbf
ba14128
2ae45c6
13451f0
b3ff024
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -691,7 +691,7 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd. | ||
options.Database = dbfake.New() | ||
options.Pubsub = pubsub.NewInMemory() | ||
} else { | ||
sqlDB, err :=ConnectToPostgres(ctx, logger, sqlDriver, vals.PostgresURL.String()) | ||
johnstcn marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
if err != nil { | ||
return xerrors.Errorf("connect to postgres: %w", err) | ||
} | ||
@@ -1953,7 +1953,7 @@ func BuildLogger(inv *clibase.Invocation, cfg *codersdk.DeploymentValues) (slog. | ||
}, nil | ||
} | ||
funcConnectToPostgres(ctx context.Context, logger slog.Logger, driver string, dbURL string) (*sql.DB, error) { | ||
logger.Debug(ctx, "connecting to postgresql") | ||
// Try to connect for 30 seconds. | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -248,6 +248,12 @@ func ExtractAPIKey(rw http.ResponseWriter, r *http.Request, cfg ExtractAPIKeyCon | ||
UserID: key.UserID, | ||
LoginType: key.LoginType, | ||
}) | ||
if errors.Is(err, sql.ErrNoRows) { | ||
johnstcn marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
return optionalWrite(http.StatusUnauthorized, codersdk.Response{ | ||
Message: SignedOutErrorMessage, | ||
Detail: "You must re-authenticate with the login provider.", | ||
}) | ||
} | ||
if err != nil { | ||
return write(http.StatusInternalServerError, codersdk.Response{ | ||
Message: "A database error occurred", | ||
Uh oh!
There was an error while loading.Please reload this page.