Skip to content

Commit

Permalink
fix: validate users and groups bugs (tkestack#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
yadzhang committed Mar 23, 2020
1 parent ca23b17 commit f8a0693
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/auth/registry/localgroup/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ func ValidateLocalGroup(group *auth.LocalGroup, authClient authinternalclient.Au
} else {
group.Status.Users[i].Name = val.Spec.Username
validUsers = append(validUsers, group.Status.Users[i])

}
}
} else {
validUsers = append(validUsers, group.Status.Users[i])
}
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/auth/registry/policy/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ func ValidatePolicy(policy *auth.Policy, authClient authinternalclient.AuthInter
validUsers = append(validUsers, policy.Status.Users[i])
}
}
} else {
validUsers = append(validUsers, policy.Status.Users[i])
}
}

Expand Down Expand Up @@ -119,6 +121,8 @@ func ValidatePolicy(policy *auth.Policy, authClient authinternalclient.AuthInter
validGroups = append(validGroups, policy.Status.Groups[i])
}
}
} else {
validGroups = append(validGroups, policy.Status.Groups[i])
}
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/auth/registry/role/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ func ValidateRole(role *auth.Role, authClient authinternalclient.AuthInterface)
validUsers = append(validUsers, role.Status.Users[i])
}
}
} else {
validUsers = append(validUsers, role.Status.Users[i])
}
}

Expand Down Expand Up @@ -112,6 +114,8 @@ func ValidateRole(role *auth.Role, authClient authinternalclient.AuthInterface)
validGroups = append(validGroups, role.Status.Groups[i])
}
}
} else {
validGroups = append(validGroups, role.Status.Groups[i])
}
}

Expand Down

0 comments on commit f8a0693

Please sign in to comment.