-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support twilio api key #5039
base: main
Are you sure you want to change the base?
Support twilio api key #5039
Conversation
AuthToken string `json:"auth_token,omitempty"` | ||
MessagingServiceSID string `json:"message_service_sid,omitempty"` | ||
// For write only, always use GetCredentialType to read the value | ||
CredentialType *TwilioCredentialType `json:"credential_type,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to CredentialType_WriteOnly
@@ -12,6 +12,7 @@ import ( | |||
) | |||
|
|||
type TwilioClientCredentials struct { | |||
CredentialType *config.TwilioCredentialType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the non-pointer type here.
var smsProviderTwilioCredentials = graphql.NewObject(graphql.ObjectConfig{ | ||
Name: "SMSProviderTwilioCredentials", | ||
Description: "Twilio credentials", | ||
Fields: graphql.Fields{ | ||
"credentialType": &graphql.Field{ | ||
Type: graphql.NewNonNull(twilioCredentialType), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to write a custom resolver that calls GetCredentialType()
?
@@ -188,16 +192,36 @@ function constructFormState( | |||
providerType = SMSProviderType.Twilio; | |||
} | |||
|
|||
let twilioCredentialType: TwilioCredentialType = | |||
TwilioCredentialType.AuthToken; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For new credentials, the default should be API key, since it it preferred way to authenticate.
@@ -65,7 +65,7 @@ var smsProviderConfigurationTwilioInput = graphql.NewInputObject(graphql.InputOb | |||
Type: graphql.NewNonNull(graphql.String), | |||
}, | |||
"apiKeySecret": &graphql.InputObjectFieldConfig{ | |||
Type: graphql.String, | |||
Type: graphql.NewNonNull(graphql.String), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't authToken, apiKeySID, apiKeySecret all be nullable?
ref DEV-2513