Files
memos/store/db/postgres/auth_config_test.go
T
boojack 0038295bbc feat(config): provision settings from secret files
- Load IdPs and supported instance-setting groups as runtime overlays from /etc/secrets.
- Reject API mutations of deployment-managed resources and serialize authentication safety checks across database drivers.
- Preserve upgrade compatibility, demo SSO policy, stable IdP ordering, and driver-specific transaction retries.
2026-07-13 22:34:24 +08:00

17 lines
495 B
Go

package postgres
import (
"testing"
"github.com/lib/pq"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
)
func TestIsRetryableAuthenticationMutationError(t *testing.T) {
db := &DB{}
require.True(t, db.IsRetryableAuthenticationMutationError(errors.Wrap(&pq.Error{Code: "40001"}, "commit failed")))
require.True(t, db.IsRetryableAuthenticationMutationError(&pq.Error{Code: "40P01"}))
require.False(t, db.IsRetryableAuthenticationMutationError(&pq.Error{Code: "23505"}))
}