Skip to content

Commit edb0e62

Browse files
authored
Merge pull request #72 from Nkmol/fix-known-host-vallowed-key-type-values
fix(kown_host) allowed public key type values
2 parents 63ddeff + 33e3c0e commit edb0e62

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

bitbucket/resource_pipeline_ssh_known_host.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func resourcePipelineSshKnownHost() *schema.Resource {
4545
"key_type": {
4646
Type: schema.TypeString,
4747
Required: true,
48-
ValidateFunc: validation.StringInSlice([]string{"Ed25519", "ECDSA", "RSA", "DSA"}, false),
48+
ValidateFunc: validation.StringInSlice([]string{"ssh-ed25519", "ecdsa-sha2-nistp256", "ssh-rsa", "ssh-dss"}, false),
4949
},
5050
"key": {
5151
Type: schema.TypeString,

bitbucket/resource_pipeline_ssh_known_host_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestAccBitbucketPipelineSshKnownHost_basic(t *testing.T) {
4040
resource.TestCheckResourceAttrPair(resourceName, "repository", "bitbucket_repository.test", "name"),
4141
resource.TestCheckResourceAttr(resourceName, "hostname", "example.com"),
4242
resource.TestCheckResourceAttr(resourceName, "public_key.#", "1"),
43-
resource.TestCheckResourceAttr(resourceName, "public_key.0.key_type", "RSA"),
43+
resource.TestCheckResourceAttr(resourceName, "public_key.0.key_type", "ssh-rsa"),
4444
resource.TestCheckResourceAttrSet(resourceName, "public_key.0.md5_fingerprint"),
4545
resource.TestCheckResourceAttrSet(resourceName, "public_key.0.sha256_fingerprint"),
4646
),
@@ -57,7 +57,7 @@ func TestAccBitbucketPipelineSshKnownHost_basic(t *testing.T) {
5757
resource.TestCheckResourceAttrPair(resourceName, "repository", "bitbucket_repository.test", "name"),
5858
resource.TestCheckResourceAttr(resourceName, "hostname", "example2.com"),
5959
resource.TestCheckResourceAttr(resourceName, "public_key.#", "1"),
60-
resource.TestCheckResourceAttr(resourceName, "public_key.0.key_type", "RSA"),
60+
resource.TestCheckResourceAttr(resourceName, "public_key.0.key_type", "ssh-rsa"),
6161
resource.TestCheckResourceAttrSet(resourceName, "public_key.0.md5_fingerprint"),
6262
resource.TestCheckResourceAttrSet(resourceName, "public_key.0.sha256_fingerprint"),
6363
),
@@ -120,7 +120,7 @@ resource "bitbucket_pipeline_ssh_known_host" "test" {
120120
hostname = %[4]q
121121
122122
public_key {
123-
key_type = "RSA"
123+
key_type = "ssh-rsa"
124124
key = base64encode(%[3]q)
125125
}
126126
}

docs/resources/pipeline_ssh_known_host.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "bitbucket_pipeline_ssh_known_host" "test" {
2121
hostname = "example.com"
2222
2323
public_key {
24-
key_type = "Ed25519"
24+
key_type = "ssh-ed25519"
2525
key = base64encode("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY")
2626
}
2727
}
@@ -38,7 +38,7 @@ The following arguments are supported:
3838

3939
### Public Key
4040

41-
* `key_type` - The type of the public key. Valid values are `Ed25519`, `ECDSA`, `RSA`, and `DSA`.
41+
* `key_type` - The type of the public key. Valid values are `ssh-ed25519`, `ecdsa-sha2-nistp256`, `ssh-rsa`, and `ssh-dss`.
4242
* `key` - The base64 encoded public key.
4343

4444
## Attributes Reference

0 commit comments

Comments
 (0)