mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
subiss needs to be part of selected fields, otherwise this attribute would be empty and will cause issues when working with the user object later on.
Signed-off-by: Kevin Schu <kevin.schu@aoe.com>
This commit is contained in:
parent
4e1f6633af
commit
4147fbeba0
@ -43,7 +43,7 @@ func NewMetaDao() MetaDAO {
|
||||
type metaDAO struct{}
|
||||
|
||||
func (md *metaDAO) GetByUsername(ctx context.Context, username string) (*models.OIDCUser, error) {
|
||||
sql := `SELECT oidc_user.id, oidc_user.user_id, oidc_user.secret, oidc_user.token,
|
||||
sql := `SELECT oidc_user.id, oidc_user.user_id, oidc_user.secret, oidc_user.subiss, oidc_user.token,
|
||||
oidc_user.creation_time, oidc_user.update_time FROM oidc_user
|
||||
JOIN harbor_user ON oidc_user.user_id = harbor_user.user_id
|
||||
WHERE harbor_user.username = ?`
|
||||
|
@ -63,6 +63,7 @@ func (suite *MetaDaoTestSuite) TestGetByUsername() {
|
||||
ou, err := suite.dao.GetByUsername(ctx, suite.username)
|
||||
suite.Nil(err)
|
||||
suite.Equal(suite.userID, ou.UserID)
|
||||
suite.Equal("ca4bb144-4b5c-4d1b-9469-69cb3768af8fhttps://sso.andrea.muellerpublic.de/auth/realms/harbor", ou.SubIss)
|
||||
suite.Equal("xxxx", ou.Token)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user