digitalocean / digitalocean/api-v2

Firewall names cannot have spaces or underscores

Open
#188 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
138
Forks
16
PR merge metrics
No merged PRs in 30d

Description

The [DigitoalOcean API Firewall section](https://developers.digitalocean.com/documentation/v2/#firewalls) has:

Name | Type | Description
-- | -- | --
name | string | A human-readable name for a Firewall

But the API rejects names such as "a_b" and "a b".
It accepts "a-b", "a.b", "ab", and "aaaaAAAAaaaaAAAAaaaaAAAAaaaaAAAAaaaaAAAAaaaaAAAAaaaaAAAAaaaaAAAA" (64-char).

I would like to use names like "hello_server-180958124".

```
2020/02/17 15:27:48 [DEBUG] DigitalOcean API Request Details:
---[ REQUEST ]---------------------------------------
PUT /v2/firewalls/cc622838-87d4-425c-bbbc-137cb1f1a940 HTTP/1.1
Host: api.digitalocean.com
User-Agent: Terraform/0.12.20 godo/1.29.0
Content-Length: 170
Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip

{
"name": "a b",
"inbound_rules": [
{
"protocol": "tcp",
"ports": "5001",
"sources": {
"addresses": [
"0.0.0.0/0",
"::/0"
]
}
}
],
"outbound_rules": null,
"droplet_ids": [
180958124
],
"tags": []
}

-----------------------------------------------------
2020/02/17 15:27:49 [DEBUG] DigitalOcean API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 422 Unprocessable Entity
Content-Length: 106
Cache-Control: no-cache
Cf-Cache-Status: DYNAMIC
Cf-Ray: 566b88b90c1fed73-SJC
Content-Type: application/json; charset=utf-8
Date: Mon, 17 Feb 2020 23:27:49 GMT
Expect-Ct: ...
Ratelimit-Limit: 5000
Ratelimit-Remaining: 4880
Ratelimit-Reset: 1581979185
Server: cloudflare
Set-Cookie: ...
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Gateway: Edge-Gateway
X-Request-Id: 71cf20f4-42fa-4271-8e4c-40598ac75d1b
X-Response-From: service
X-Runtime: 0.230148
X-Xss-Protection: 1; mode=block

{
"id": "unprocessable_entity",
"message": "invalid name",
"request_id": "71cf20f4-42fa-4271-8e4c-40598ac75d1b"
}
-----------------------------------------------------
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.