feat: NPM access list support (global default + per-project override)

This commit is contained in:
2026-04-05 12:38:20 +03:00
parent 4ff8daafc4
commit c6d20ca26e
10 changed files with 127 additions and 31 deletions
+9
View File
@@ -175,6 +175,15 @@ func (c *Client) FindProxyHostByDomain(ctx context.Context, domain string) (Prox
return ProxyHost{}, false, nil
}
// ListAccessLists returns all access lists from NPM.
func (c *Client) ListAccessLists(ctx context.Context) ([]AccessList, error) {
var lists []AccessList
if err := c.doJSON(ctx, http.MethodGet, "/nginx/access-lists", nil, &lists); err != nil {
return nil, fmt.Errorf("list access lists: %w", err)
}
return lists, nil
}
// ListCertificates returns all SSL certificates from NPM.
func (c *Client) ListCertificates(ctx context.Context) ([]Certificate, error) {
var certs []Certificate
+6
View File
@@ -50,6 +50,12 @@ type ProxyHost struct {
ModifiedOn string `json:"modified_on"`
}
// AccessList represents an access list as returned by the NPM API.
type AccessList struct {
ID int `json:"id"`
Name string `json:"name"`
}
// Certificate represents an SSL certificate as returned by the NPM API.
type Certificate struct {
ID int `json:"id"`