Skip to content
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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Support twilio api key #5039

wants to merge 14 commits into from

Conversation

tung2744
Copy link
Contributor

ref DEV-2513

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"`
Copy link
Collaborator

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
Copy link
Collaborator

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),
},
Copy link
Collaborator

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;
Copy link
Collaborator

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),
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants