mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-01 04:40:38 +00:00
Adding authorisation options for API access
- ldap currently the only supported method adding authorisation options for local repositories - ldap groups per repo
This commit is contained in:
@@ -27,6 +27,8 @@ type LocalRepo struct {
|
||||
Uploaders *Uploaders `codec:"Uploaders,omitempty" json:"-"`
|
||||
// "Snapshot" of current list of packages
|
||||
packageRefs *PackageRefList
|
||||
// ldap group for repos
|
||||
LdapGroup string `codec:",ldap-group"`
|
||||
}
|
||||
|
||||
// NewLocalRepo creates new instance of Debian local repository
|
||||
@@ -54,6 +56,14 @@ func (repo *LocalRepo) NumPackages() int {
|
||||
return repo.packageRefs.Len()
|
||||
}
|
||||
|
||||
// LdapGroup returns the ldapgroup if any for the repo
|
||||
func (repo *LocalRepo) GetLDGroup() string {
|
||||
if repo.LdapGroup != "" {
|
||||
return fmt.Sprintf("[%s]", repo.LdapGroup)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// RefList returns package list for repo
|
||||
func (repo *LocalRepo) RefList() *PackageRefList {
|
||||
return repo.packageRefs
|
||||
|
||||
Reference in New Issue
Block a user