Skip to content

Commit

Permalink
fix(ldap): update url: AnyURL to urls: list[AnyURL] (#218)
Browse files Browse the repository at this point in the history
* fix: `url: AnyURL` -> `urls: typing.List[AnyURL]`

Signed-off-by: Jason C. Nucciarone <[email protected]>

* feat: add sssd charm as `ldap` interface requirer

Signed-off-by: Jason C. Nucciarone <[email protected]>

* fix: update ldap provider json schema

Signed-off-by: Jason C. Nucciarone <[email protected]>

---------

Signed-off-by: Jason C. Nucciarone <[email protected]>
  • Loading branch information
NucciTheBoss authored Feb 3, 2025
1 parent 1e27162 commit 8bf9bb5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
22 changes: 14 additions & 8 deletions docs/json_schemas/ldap/v0/provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
},
"LdapProviderData": {
"properties": {
"url": {
"description": "The LDAP URL",
"example": "ldap://ldap.canonical.com:3893",
"format": "uri",
"minLength": 1,
"title": "LDAP URL",
"type": "string"
"urls": {
"description": "List of LDAP URLs",
"example": [
"ldap://ldap.canonical.com:3893",
"ldap://ldap.ubuntu.com:3893"
],
"items": {
"format": "uri",
"minLength": 1,
"type": "string"
},
"title": "LDAP URLs",
"type": "array"
},
"base_dn": {
"description": "The base entry as the starting point for LDAP search operation",
Expand Down Expand Up @@ -47,7 +53,7 @@
}
},
"required": [
"url",
"urls",
"base_dn",
"bind_dn",
"bind_password_secret",
Expand Down
4 changes: 2 additions & 2 deletions interfaces/ldap/v0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ be able to provide or consume the LDAP authentication configuration data.
```mermaid
flowchart TD
Requirer -- user, \ngroup --> Provider
Provider -- url, \nbase_dn, \nbind_dn, \nbind_password_secret, \nauth_method, \nstarttls --> Requirer
Provider -- urls, \nbase_dn, \nbind_dn, \nbind_password_secret, \nauth_method, \nstarttls --> Requirer
```

## Behavior
Expand Down Expand Up @@ -66,7 +66,7 @@ It should be placed in the **application** databag.
- endpoint: ldap
related-endpoint: ldap
application-data:
url: ldap://ldap.canonical.com:3893
urls: [ldap://ldap.canonical.com:3893, ldap://ldap.ubuntu.com:3893]
base_dn: dc=canonical,dc=com
bind_dn: cn=app,ou=model,dc=canonical,dc=com
bind_password_secret: secret://59060ecc-0495-4a80-8006-5f1fc13fd783/cjqub6vubg2s77p3nio0
Expand Down
4 changes: 3 additions & 1 deletion interfaces/ldap/v0/interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ status: draft
providers:
- name: glauth-k8s
url: https://github.com/canonical/glauth-k8s-operator
requirers: []
requirers:
- name: sssd
url: https://github.com/canonical/sssd-operator

maintainer: identity
10 changes: 5 additions & 5 deletions interfaces/ldap/v0/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
- RequirerSchema
"""

from typing import Optional
from typing import List, Optional

from interface_tester.schema_base import DataBagSchema
from pydantic import AnyUrl, BaseModel, Field


class LdapProviderData(BaseModel):
url: AnyUrl = Field(
description="The LDAP URL",
title="LDAP URL",
example="ldap://ldap.canonical.com:3893",
urls: List[AnyUrl] = Field(
description="List of LDAP URLs",
title="LDAP URLs",
example=["ldap://ldap.canonical.com:3893", "ldap://ldap.ubuntu.com:3893"],
)
base_dn: str = Field(
description="The base entry as the starting point for LDAP search "
Expand Down

0 comments on commit 8bf9bb5

Please sign in to comment.