mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-19 12:07:18 +02:00
config: remove source, remove deadcode, fix linting issues (#4118)
* remove source, remove deadcode, fix linting issues * use github action for lint * fix missing envoy
This commit is contained in:
parent
34c1e44c7e
commit
bbed421cd8
122 changed files with 438 additions and 998 deletions
|
@ -124,9 +124,9 @@ func getNextChangedRecord(ctx context.Context, q querier, recordType string, aft
|
|||
return nil, fmt.Errorf("error querying next changed record: %w", err)
|
||||
}
|
||||
|
||||
any, err := protoutil.UnmarshalAnyJSON(data)
|
||||
a, err := protoutil.UnmarshalAnyJSON(data)
|
||||
if isUnknownType(err) {
|
||||
any = protoutil.ToAny(protoutil.ToStruct(map[string]string{
|
||||
a = protoutil.ToAny(protoutil.ToStruct(map[string]string{
|
||||
"id": recordID,
|
||||
}))
|
||||
} else if err != nil {
|
||||
|
@ -137,7 +137,7 @@ func getNextChangedRecord(ctx context.Context, q querier, recordType string, aft
|
|||
Version: version,
|
||||
Type: recordType,
|
||||
Id: recordID,
|
||||
Data: any,
|
||||
Data: a,
|
||||
ModifiedAt: timestamppbFromTimestamptz(modifiedAt),
|
||||
DeletedAt: timestamppbFromTimestamptz(deletedAt),
|
||||
}, nil
|
||||
|
@ -175,7 +175,7 @@ func getRecord(ctx context.Context, q querier, recordType, recordID string) (*da
|
|||
return nil, fmt.Errorf("postgres: failed to execute query: %w", err)
|
||||
}
|
||||
|
||||
any, err := protoutil.UnmarshalAnyJSON(data)
|
||||
a, err := protoutil.UnmarshalAnyJSON(data)
|
||||
if isUnknownType(err) {
|
||||
return nil, storage.ErrNotFound
|
||||
} else if err != nil {
|
||||
|
@ -186,7 +186,7 @@ func getRecord(ctx context.Context, q querier, recordType, recordID string) (*da
|
|||
Version: version,
|
||||
Type: recordType,
|
||||
Id: recordID,
|
||||
Data: any,
|
||||
Data: a,
|
||||
ModifiedAt: timestamppbFromTimestamptz(modifiedAt),
|
||||
}, nil
|
||||
}
|
||||
|
@ -226,9 +226,9 @@ func listRecords(ctx context.Context, q querier, expr storage.FilterExpression,
|
|||
return nil, fmt.Errorf("postgres: failed to scan row: %w", err)
|
||||
}
|
||||
|
||||
any, err := protoutil.UnmarshalAnyJSON(data)
|
||||
a, err := protoutil.UnmarshalAnyJSON(data)
|
||||
if isUnknownType(err) {
|
||||
any = protoutil.ToAny(protoutil.ToStruct(map[string]string{
|
||||
a = protoutil.ToAny(protoutil.ToStruct(map[string]string{
|
||||
"id": id,
|
||||
}))
|
||||
} else if err != nil {
|
||||
|
@ -239,7 +239,7 @@ func listRecords(ctx context.Context, q querier, expr storage.FilterExpression,
|
|||
Version: version,
|
||||
Type: recordType,
|
||||
Id: id,
|
||||
Data: any,
|
||||
Data: a,
|
||||
ModifiedAt: timestamppbFromTimestamptz(modifiedAt),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ func TestRegistry(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestUnmarshalJSONUnknownFields(t *testing.T) {
|
||||
any, err := protoutil.UnmarshalAnyJSON([]byte(`
|
||||
data, err := protoutil.UnmarshalAnyJSON([]byte(`
|
||||
{
|
||||
"@type": "type.googleapis.com/registry.Service",
|
||||
"kind": "AUTHENTICATE",
|
||||
|
@ -125,7 +125,7 @@ func TestUnmarshalJSONUnknownFields(t *testing.T) {
|
|||
`))
|
||||
require.NoError(t, err)
|
||||
var val registry.Service
|
||||
require.NoError(t, any.UnmarshalTo(&val))
|
||||
require.NoError(t, data.UnmarshalTo(&val))
|
||||
assert.Equal(t, registry.ServiceKind_AUTHENTICATE, val.Kind)
|
||||
assert.Equal(t, "endpoint", val.Endpoint)
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ func (stream *recordStream) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (stream *recordStream) Next(block bool) bool {
|
||||
func (stream *recordStream) Next(_ bool) bool {
|
||||
if stream.err != nil {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue