Skip to content

Commit

Permalink
update comments to please linter
Browse files Browse the repository at this point in the history
  • Loading branch information
lochiiconnectivity committed Mar 16, 2023
1 parent 45bfaaa commit 836b4da
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
30 changes: 15 additions & 15 deletions management/guardian.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ type MultiFactorPushCustomApp struct {
GoogleAppLink *string `json:"google_app_link,omitempty"`
}

// MultiFactorPushDirectAPNS holds the Apple APNS provider configuration
// MultiFactorPushDirectAPNS holds the Apple APNS provider configuration.
type MultiFactorPushDirectAPNS struct {
Sandbox *bool `json:"sandbox,omitempty"`
BundleID *string `json:"bundle_id,omitempty"`
P12 *string `json:"p12,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Sandbox *bool `json:"sandbox,omitempty"`
BundleID *string `json:"bundle_id,omitempty"`
P12 *string `json:"p12,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}

// MultiFactorPushDirectFCM holds the Google FCM provider configuration
// MultiFactorPushDirectFCM holds the Google FCM provider configuration.
type MultiFactorPushDirectFCM struct {
// FCM Server Key
ServerKey *string `json:"server_key,omitempty"`
// FCM Server Key
ServerKey *string `json:"server_key,omitempty"`
}

// MultiFactorProviderTwilio is used for Twilio MultiFactor Authentication.
Expand Down Expand Up @@ -369,25 +369,25 @@ func (m *MultiFactorPush) UpdateCustomApp(a *MultiFactorPushCustomApp, opts ...R
return m.Request("PATCH", m.URI("prompts", "mfa-push"), a, opts...)
}

// APNS returns the Apple APNS provider configuration for direct mode
// DirectAPNS returns the Apple APNS provider configuration for direct mode.
// See: https://auth0.com/docs/api/management/v2#!/Guardian/get_apns
func (m *MultiFactorPush) DirectAPNS(opts ...RequestOption) (s *MultiFactorPushDirectAPNS, err error) {
err = m.Request("GET", m.URI("guardian", "factors", "push-notification", "providers", "apns"), &s, opts...)
return
err = m.Request("GET", m.URI("guardian", "factors", "push-notification", "providers", "apns"), &s, opts...)
return
}

// UpdateAPNS updates the Apple APNS provider configuration for direct mode
// UpdateDirectAPNS updates the Apple APNS provider configuration for direct mode.
//
// See: https://auth0.com/docs/api/management/v2#!/Guardian/patch_apns
func (m *MultiFactorPush) UpdateDirectAPNS(sc *MultiFactorPushDirectAPNS, opts ...RequestOption) error {
return m.Request("PUT", m.URI("guardian", "factors", "push-notification", "providers", "apns"), sc, opts...)
return m.Request("PUT", m.URI("guardian", "factors", "push-notification", "providers", "apns"), sc, opts...)
}

// UpdateFCM updates the Google FCM provider configuration for direct mode
// UpdateDirectFCM updates the Google FCM provider configuration for direct mode.
//
// See: https://auth0.com/docs/api/management/v2#!/Guardian/patch_fcm
func (m *MultiFactorPush) UpdateDirectFCM(sc *MultiFactorPushDirectFCM, opts ...RequestOption) error {
return m.Request("PUT", m.URI("guardian", "factors", "push-notification", "providers", "fcm"), sc, opts...)
return m.Request("PUT", m.URI("guardian", "factors", "push-notification", "providers", "fcm"), sc, opts...)
}

// AmazonSNS returns the Amazon Web Services (AWS) Simple Notification Service
Expand Down
11 changes: 5 additions & 6 deletions management/guardian_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ func TestGuardian(t *testing.T) {
assert.NoError(t, err)

expectedDirectAPNS := &MultiFactorPushDirectAPNS{
Sandbox: auth0.Bool(false),
BundleID: auth0.String("com.my.app"),
P12: auth0.String(string(expectedP12)),
Sandbox: auth0.Bool(false),
BundleID: auth0.String("com.my.app"),
P12: auth0.String(string(expectedP12)),
}
err = api.Guardian.MultiFactor.Push.UpdateDirectAPNS(expectedDirectAPNS)
assert.NoError(t, err)
Expand All @@ -290,18 +290,17 @@ func TestGuardian(t *testing.T) {
assert.Equal(t, expectedDirectAPNS.GetSandbox(), actualDirectAPNS.GetSandbox())
assert.Equal(t, expectedDirectAPNS.GetBundleID(), actualDirectAPNS.GetBundleID())
// Cannot test enabled parameter as we cannot send it

})

t.Run("DirectFCM", func(t *testing.T) {
configureHTTPTestRecordings(t)

// This is a write only property
// This is a write only property

err := error(nil)

expectedDirectFCM := &MultiFactorPushDirectFCM{
ServerKey: auth0.String("abc123"),
ServerKey: auth0.String("abc123"),
}
err = api.Guardian.MultiFactor.Push.UpdateDirectFCM(expectedDirectFCM)
assert.NoError(t, err)
Expand Down

0 comments on commit 836b4da

Please sign in to comment.