Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dns_record interface to remove service_account #205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/json_schemas/dns_record/v0/provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"description": "Status for the domain request.",
"examples": [
"approved",
"invalid_credentials"
"permission_denied"
tonyandrewmeyer marked this conversation as resolved.
Show resolved Hide resolved
],
"name": "Status"
},
Expand All @@ -65,7 +65,6 @@
"description": "Represent the status values.",
"enum": [
"approved",
"invalid_credentials",
"permission_denied",
"conflict",
"invalid_data",
Expand Down
8 changes: 0 additions & 8 deletions docs/json_schemas/dns_record/v0/requirer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
"DNSRecordRequirer": {
"description": "List of domains for the provider to manage.",
"properties": {
"service_account": {
"description": "Service account for authentication.",
"examples": "secret:123213123123123123123",
"name": "Service account",
"title": "Service Account",
"type": "string"
},
"dns_entries": {
"description": "List of DNS records for the provider to manage.",
"items": {
Expand All @@ -26,7 +19,6 @@
}
},
"required": [
"service_account",
"dns_entries"
],
"title": "DNSRecordRequirer",
Expand Down
5 changes: 1 addition & 4 deletions interfaces/dns_record/v0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This relation interface describes the expected behavior of any charm claiming to
The `dns_record` interface implements a provider/requirer pattern. The requirer is a charm that wishes to create a set of DNS records, and the provider is the charm managing those.
```mermaid
flowchart TD
Requirer -- service_account, dns_entries --> Provider
Requirer -- dns_entries --> Provider
Provider -- dns_entries --> Requirer
```

Expand All @@ -20,11 +20,9 @@ The following is the criteria that a Provider and Requirer need to adhere to be
### Provider

- Is expected to provide a list of dns_entries in the relation databag, each containing the domain, the status and optionally the description corresponding to the dns_entries requirested by the requirer.
- Is expected to authenticate requests for dns_entries based on internal business rules/processes at the organisation where this charm is deployed.

### Requirer

- Is expected to provide a service_account for the provider to authenticate the requests.
- Is expected to provide a list of dns_entries mains in the relation databag, containing at least the dns-domain, the host-label and record-data. The dns-domain must be present in the list of dns_domains for authentication.


Expand Down Expand Up @@ -64,7 +62,6 @@ Requirer request the details of one or more DNS records. It should be placed in

```json
"application-data": {
"service_account": "secret:123213123123123123123",
"dns_entries": [
{
"uuid": "550e8400-e29b-41d4-a716-446655440002",
Expand Down
9 changes: 1 addition & 8 deletions interfaces/dns_record/v0/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
RequirerSchema:
unit: <empty>
app: {
"service_account": "secret:123213123123123123123",
"dns_entries": [
{
"uuid": "550e8400-e29b-41d4-a716-446655440002",
Expand Down Expand Up @@ -59,7 +58,6 @@ class Status(str, Enum):
"""Represent the status values."""

APPROVED = "approved"
INVALID_CREDENTIALS = "invalid_credentials"
PERMISSION_DENIED = "permission_denied"
CONFLICT = "conflict"
INVALID_DATA = "invalid_data"
Expand Down Expand Up @@ -104,7 +102,7 @@ class DnsProviderData(BaseModel):
status: Status = Field(
name="Status",
description="Status for the domain request.",
examples=[Status.APPROVED, Status.INVALID_CREDENTIALS]
examples=[Status.APPROVED, Status.PERMISSION_DENIED]
)
description: str = Field(
default=None,
Expand Down Expand Up @@ -167,11 +165,6 @@ class RequirerEntries(BaseModel):

class DNSRecordRequirer(BaseModel):
"""List of domains for the provider to manage."""
service_account: str = Field(
name="Service account",
description="Service account for authentication.",
examples="secret:123213123123123123123"
)
dns_entries: List[RequirerEntries] = Field(
name="DNS entries",
description="List of DNS records for the provider to manage."
Expand Down
Loading