Skip to content

Commit

Permalink
Don't allow cloning of config repo if anon isn't set to read-write
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Padilla committed Oct 4, 2021
1 parent 73edc31 commit e198dc4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion config/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ func (cfg *Config) accessForKey(repo string, pk ssh.PublicKey) gm.AccessLevel {
return gm.ReadWriteAccess
}
}
return gm.ReadOnlyAccess
if repo != "config" {
return gm.ReadOnlyAccess
}
}
}
if repo == "config" && (cfg.AnonAccess != "read-write") {
return gm.NoAccess
}
switch cfg.AnonAccess {
case "no-access":
return gm.NoAccess
Expand Down

0 comments on commit e198dc4

Please sign in to comment.