forked from integrations/terraform-provider-github
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request integrations#134 from terraform-providers/b-org-we…
…bhook-secret resource/github_organization_webhook: Avoid spurious diff
- Loading branch information
Showing
6 changed files
with
109 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package github | ||
|
||
import ( | ||
"github.com/hashicorp/terraform/helper/schema" | ||
) | ||
|
||
func webhookConfigurationSchema() *schema.Schema { | ||
return &schema.Schema{ | ||
Type: schema.TypeList, | ||
MaxItems: 1, | ||
Optional: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"url": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, | ||
"content_type": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
}, | ||
"secret": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Sensitive: true, | ||
DiffSuppressFunc: func(k, oldV, newV string, d *schema.ResourceData) bool { | ||
// Undocumented GitHub feature where API returns 8 asterisks in place of the secret | ||
maskedSecret := "********" | ||
if oldV == maskedSecret { | ||
return true | ||
} | ||
|
||
return oldV == newV | ||
}, | ||
}, | ||
"insecure_ssl": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |