@@ -6,15 +6,13 @@ import (
6
6
"encoding/json"
7
7
"errors"
8
8
"fmt"
9
- "io"
10
9
"net/http"
11
10
"net/mail"
12
11
"regexp"
13
12
"sort"
14
13
"strconv"
15
14
"strings"
16
15
"sync"
17
- "sync/atomic"
18
16
"time"
19
17
20
18
"github.com/coreos/go-oidc/v3/oidc"
@@ -1191,26 +1189,6 @@ func blankFields(claims map[string]interface{}) []string {
1191
1189
return fields
1192
1190
}
1193
1191
1194
- // fieldSizes returns the sorted sizes of fields in the claims map
1195
- func fieldSizes (claims map [string ]interface {}) []int {
1196
- fs := claimFields (claims )
1197
- lens := make ([]int , len (fs ))
1198
- for i , f := range fs {
1199
- v , ok := claims [f ]
1200
- if ! ok {
1201
- lens [i ] = - 1
1202
- continue
1203
- }
1204
- vs , ok := v .(string )
1205
- if ! ok {
1206
- lens [i ] = - 1
1207
- continue
1208
- }
1209
- lens [i ] = len (vs )
1210
- }
1211
- return lens
1212
- }
1213
-
1214
1192
// mergeClaims merges the claims from a and b and returns the merged set.
1215
1193
// claims from b take precedence over claims from a.
1216
1194
func mergeClaims (a , b map [string ]interface {}) map [string ]interface {} {
@@ -1894,20 +1872,3 @@ func parseStringSliceClaim(claim interface{}) ([]string, error) {
1894
1872
// Not sure what the user gave us.
1895
1873
return nil , xerrors .Errorf ("invalid claim type. Expected an array of strings, got: %T" , claim )
1896
1874
}
1897
-
1898
- type countWriter struct {
1899
- w io.Writer
1900
- bytesWritten atomic.Int64
1901
- }
1902
-
1903
- func (cw * countWriter ) Write (p []byte ) (int , error ) {
1904
- n , err := cw .w .Write (p )
1905
- if n > 0 {
1906
- cw .bytesWritten .Add (int64 (n ))
1907
- }
1908
- return n , err
1909
- }
1910
-
1911
- func (cw * countWriter ) Length () int {
1912
- return int (cw .bytesWritten .Load ())
1913
- }
0 commit comments