mirror of
https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git
synced 2024-12-04 21:08:11 +00:00
fix(gitea_oauth_app): added missing createoptions and resourcedata
This commit is contained in:
parent
5b14a5d789
commit
c707cba22e
1 changed files with 13 additions and 5 deletions
|
@ -96,9 +96,16 @@ func resourceOauth2AppUpcreate(d *schema.ResourceData, meta interface{}) (err er
|
||||||
return fmt.Errorf("attribute %s must be set and must be a string", oauth2KeyName)
|
return fmt.Errorf("attribute %s must be set and must be a string", oauth2KeyName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
confidentialClient, confidentialClientOk := d.Get(oauth2KeyConfidentialClient).(bool)
|
||||||
|
|
||||||
|
if !confidentialClientOk {
|
||||||
|
return fmt.Errorf("attribute %s must be set and must be a bool", oauth2KeyConfidentialClient)
|
||||||
|
}
|
||||||
|
|
||||||
opts := gitea.CreateOauth2Option{
|
opts := gitea.CreateOauth2Option{
|
||||||
Name: name,
|
Name: name,
|
||||||
RedirectURIs: redirectURIs,
|
ConfidentialClient: confidentialClient,
|
||||||
|
RedirectURIs: redirectURIs,
|
||||||
}
|
}
|
||||||
|
|
||||||
var oauth2 *gitea.Oauth2
|
var oauth2 *gitea.Oauth2
|
||||||
|
@ -183,9 +190,10 @@ func setOAuth2ResourceData(app *gitea.Oauth2, d *schema.ResourceData) (err error
|
||||||
d.SetId(app.ClientID)
|
d.SetId(app.ClientID)
|
||||||
|
|
||||||
for k, v := range map[string]interface{}{
|
for k, v := range map[string]interface{}{
|
||||||
oauth2KeyName: app.Name,
|
oauth2KeyName: app.Name,
|
||||||
oauth2KeyRedirectURIs: schema.NewSet(schema.HashString, CollapseStringList(app.RedirectURIs)),
|
oauth2KeyConfidentialClient: app.ConfidentialClient,
|
||||||
oauth2KeyClientId: app.ClientID,
|
oauth2KeyRedirectURIs: schema.NewSet(schema.HashString, CollapseStringList(app.RedirectURIs)),
|
||||||
|
oauth2KeyClientId: app.ClientID,
|
||||||
} {
|
} {
|
||||||
err = d.Set(k, v)
|
err = d.Set(k, v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue