unexport as much as possible in the audit package (#28039)

This commit is contained in:
Peter Wilson
2024-08-09 17:03:29 +01:00
committed by GitHub
parent 88975a6c24
commit a19195c901
30 changed files with 429 additions and 419 deletions

View File

@@ -25,7 +25,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
}{
"happy-path-json": {
config: map[string]string{
"format": JSONFormat.String(),
"format": jsonFormat.String(),
"hmac_accessor": "true",
"log_raw": "true",
"elide_list_responses": "true",
@@ -39,7 +39,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
},
"happy-path-jsonx": {
config: map[string]string{
"format": JSONxFormat.String(),
"format": jsonxFormat.String(),
"hmac_accessor": "true",
"log_raw": "true",
"elide_list_responses": "true",
@@ -65,7 +65,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
},
"invalid-hmac-accessor": {
config: map[string]string{
"format": JSONFormat.String(),
"format": jsonFormat.String(),
"hmac_accessor": "maybe",
},
want: formatterConfig{},
@@ -74,7 +74,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
},
"invalid-log-raw": {
config: map[string]string{
"format": JSONFormat.String(),
"format": jsonFormat.String(),
"hmac_accessor": "true",
"log_raw": "maybe",
},
@@ -84,7 +84,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
},
"invalid-elide-bool": {
config: map[string]string{
"format": JSONFormat.String(),
"format": jsonFormat.String(),
"hmac_accessor": "true",
"log_raw": "true",
"elide_list_responses": "maybe",
@@ -95,11 +95,11 @@ func TestBackend_newFormatterConfig(t *testing.T) {
},
"prefix": {
config: map[string]string{
"format": JSONFormat.String(),
"format": jsonFormat.String(),
"prefix": "foo",
},
want: formatterConfig{
requiredFormat: JSONFormat,
requiredFormat: jsonFormat,
prefix: "foo",
hmacAccessor: true,
},
@@ -111,7 +111,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
got, err := newFormatterConfig(&NoopHeaderFormatter{}, tc.config)
got, err := newFormatterConfig(&noopHeaderFormatter{}, tc.config)
if tc.wantErr {
require.Error(t, err)
require.EqualError(t, err, tc.expectedMessage)
@@ -133,7 +133,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
func TestBackend_configureFormatterNode(t *testing.T) {
t.Parallel()
b, err := newBackend(&NoopHeaderFormatter{}, &BackendConfig{
b, err := newBackend(&noopHeaderFormatter{}, &BackendConfig{
MountPath: "foo",
Logger: hclog.NewNullLogger(),
})