|
|
|
@ -96,8 +96,15 @@ func resourceOauth2AppUpcreate(d *schema.ResourceData, meta interface{}) (err er
|
|
|
|
|
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{
|
|
|
|
|
Name: name,
|
|
|
|
|
ConfidentialClient: confidentialClient,
|
|
|
|
|
RedirectURIs: redirectURIs,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -184,6 +191,7 @@ func setOAuth2ResourceData(app *gitea.Oauth2, d *schema.ResourceData) (err error
|
|
|
|
|
|
|
|
|
|
for k, v := range map[string]interface{}{
|
|
|
|
|
oauth2KeyName: app.Name,
|
|
|
|
|
oauth2KeyConfidentialClient: app.ConfidentialClient,
|
|
|
|
|
oauth2KeyRedirectURIs: schema.NewSet(schema.HashString, CollapseStringList(app.RedirectURIs)),
|
|
|
|
|
oauth2KeyClientId: app.ClientID,
|
|
|
|
|
} {
|
|
|
|
|