Skip to content

Commit a8863e4

Browse files
committed
Rename basic authentication to password
1 parent 2595156 commit a8863e4

12 files changed

+15
-15
lines changed

coderd/database/dump.sql

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/migrations/000001_base.up.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
-- https://github.com/coder/m/blob/47b6fc383347b9f9fab424d829c482defd3e1fe2/product/coder/pkg/database/dump.sql
66

77
CREATE TYPE login_type AS ENUM (
8-
'basic',
8+
'password',
99
'github'
1010
);
1111

coderd/database/models.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/httpmw/apikey.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func ExtractAPIKey(db database.Store, oauth *OAuth2Configs) func(http.Handler) h
9999
// Tracks if the API key has properties updated!
100100
changed := false
101101

102-
if key.LoginType != database.LoginTypeBasic {
102+
if key.LoginType != database.LoginTypePassword {
103103
// Check if the OAuth token is expired!
104104
if key.OAuthExpiry.Before(now) && !key.OAuthExpiry.IsZero() {
105105
var oauthConfig OAuth2Config

coderd/httpmw/organizationparam_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestOrganizationParam(t *testing.T) {
4141
ID: userID,
4242
Email: "testaccount@coder.com",
4343
Name: "example",
44-
LoginType: database.LoginTypeBasic,
44+
LoginType: database.LoginTypePassword,
4545
HashedPassword: hashed[:],
4646
Username: username,
4747
CreatedAt: database.Now(),

coderd/httpmw/templateparam_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestTemplateParam(t *testing.T) {
4040
ID: userID,
4141
Email: "testaccount@coder.com",
4242
Name: "example",
43-
LoginType: database.LoginTypeBasic,
43+
LoginType: database.LoginTypePassword,
4444
HashedPassword: hashed[:],
4545
Username: username,
4646
CreatedAt: database.Now(),

coderd/httpmw/templateversionparam_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestTemplateVersionParam(t *testing.T) {
4040
ID: userID,
4141
Email: "testaccount@coder.com",
4242
Name: "example",
43-
LoginType: database.LoginTypeBasic,
43+
LoginType: database.LoginTypePassword,
4444
HashedPassword: hashed[:],
4545
Username: username,
4646
CreatedAt: database.Now(),

coderd/httpmw/workspaceagentparam_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestWorkspaceAgentParam(t *testing.T) {
4040
ID: userID,
4141
Email: "testaccount@coder.com",
4242
Name: "example",
43-
LoginType: database.LoginTypeBasic,
43+
LoginType: database.LoginTypePassword,
4444
HashedPassword: hashed[:],
4545
Username: username,
4646
CreatedAt: database.Now(),

coderd/httpmw/workspacebuildparam_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestWorkspaceBuildParam(t *testing.T) {
4040
ID: userID,
4141
Email: "testaccount@coder.com",
4242
Name: "example",
43-
LoginType: database.LoginTypeBasic,
43+
LoginType: database.LoginTypePassword,
4444
HashedPassword: hashed[:],
4545
Username: username,
4646
CreatedAt: database.Now(),

coderd/httpmw/workspaceparam_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestWorkspaceParam(t *testing.T) {
4040
ID: userID,
4141
Email: "testaccount@coder.com",
4242
Name: "example",
43-
LoginType: database.LoginTypeBasic,
43+
LoginType: database.LoginTypePassword,
4444
HashedPassword: hashed[:],
4545
Username: username,
4646
CreatedAt: database.Now(),

coderd/userauth_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (*oauth2Config) TokenSource(context.Context, *oauth2.Token) oauth2.TokenSou
3333

3434
func TestUserAuthMethods(t *testing.T) {
3535
t.Parallel()
36-
t.Run("Basic", func(t *testing.T) {
36+
t.Run("Password", func(t *testing.T) {
3737
t.Parallel()
3838
client := coderdtest.New(t, nil)
3939
methods, err := client.AuthMethods(context.Background())

coderd/users.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ func (api *api) postLogin(rw http.ResponseWriter, r *http.Request) {
377377

378378
sessionToken, created := api.createAPIKey(rw, r, database.InsertAPIKeyParams{
379379
UserID: user.ID,
380-
LoginType: database.LoginTypeBasic,
380+
LoginType: database.LoginTypePassword,
381381
})
382382
if !created {
383383
return
@@ -402,7 +402,7 @@ func (api *api) postAPIKey(rw http.ResponseWriter, r *http.Request) {
402402

403403
sessionToken, created := api.createAPIKey(rw, r, database.InsertAPIKeyParams{
404404
UserID: user.ID,
405-
LoginType: database.LoginTypeBasic,
405+
LoginType: database.LoginTypePassword,
406406
})
407407
if !created {
408408
return
@@ -843,7 +843,7 @@ func (api *api) createUser(ctx context.Context, req codersdk.CreateUserRequest)
843843
ID: uuid.New(),
844844
Email: req.Email,
845845
Username: req.Username,
846-
LoginType: database.LoginTypeBasic,
846+
LoginType: database.LoginTypePassword,
847847
CreatedAt: database.Now(),
848848
UpdatedAt: database.Now(),
849849
}

0 commit comments

Comments
 (0)