Commit 336cd671 authored by ale's avatar ale

Remove Database.CleartextPassword from the data model

There's no reason for it to be exposed, it is currently an
implementation detail in how new MySQL databases are created (the
password reset flow for databases does not use it after that).
parent 2e6cde96
Pipeline #3517 passed with stages
in 4 minutes and 42 seconds
......@@ -256,7 +256,6 @@ This is an example of a simple user, as returned by `/api/user/get`:
"group": "uno",
"database": {
"db_user": "unodb",
"cleartext_password": "password"
}
},
{
......
......@@ -116,8 +116,7 @@ func TestModel_GetUser(t *testing.T) {
OriginalShard: "host2",
Status: as.ResourceStatusActive,
Database: &as.Database{
CleartextPassword: "password",
DBUser: "unodb",
DBUser: "unodb",
},
}
if err := deep.Equal(db, expectedDB); err != nil {
......
......@@ -430,8 +430,7 @@ func (h *databaseResourceHandler) FromLDAP(entry *ldap.Entry) (*as.Resource, err
ParentID: as.ResourceID(parentDN),
Name: name,
Database: &as.Database{
DBUser: entry.GetAttributeValue("dbuser"),
CleartextPassword: entry.GetAttributeValue("clearPassword"),
DBUser: entry.GetAttributeValue("dbuser"),
},
}, nil
}
......@@ -441,7 +440,6 @@ func (h *databaseResourceHandler) ToLDAP(rsrc *as.Resource) []ldap.PartialAttrib
{Type: "objectClass", Vals: []string{"top", "dbMysql"}},
{Type: "dbname", Vals: s2l(rsrc.Name)},
{Type: "dbuser", Vals: s2l(rsrc.Database.DBUser)},
{Type: "clearPassword", Vals: s2l(rsrc.Database.CleartextPassword)},
}
}
......
......@@ -108,8 +108,7 @@ func TestResource_LDAPSerialization(t *testing.T) {
Name: "testdb",
Status: as.ResourceStatusActive,
Database: &as.Database{
DBUser: "testdbuser",
CleartextPassword: "secretpassword",
DBUser: "testdbuser",
},
},
......
......@@ -562,8 +562,7 @@ type Website struct {
// Database resource attributes.
type Database struct {
DBUser string `json:"db_user"`
CleartextPassword string `json:"cleartext_password"`
DBUser string `json:"db_user"`
}
// CMSInfo holds CMS-specific information.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment