Skip to content

Commit 834d5b1

Browse files
authored
OAS-10576 fix vulncheck errors (#658)
* Updated go to 1.22.11 * Change log + jwt v5 update * Added LSP Compatible Deprecated tags
1 parent 971abc5 commit 834d5b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+130
-115
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ orbs:
44
executors:
55
golang-executor:
66
docker:
7-
- image: gcr.io/gcr-for-testing/golang:1.22.8
7+
- image: gcr.io/gcr-for-testing/golang:1.22.11
88
machine-executor:
99
machine:
1010
image: ubuntu-2204:current

CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
## [master](https://github.com/arangodb/go-driver/tree/master) (N/A)
44

5-
## [1.6.5(https://github.com/arangodb/go-driver/tree/v1.6.5) (2024-11-15)
5+
## [1.6.6](https://github.com/arangodb/go-driver/tree/v1.6.6) (2025-02-21)
6+
- Switch to Go 1.22.11
7+
- Switch to jwt-go v5
8+
9+
## [1.6.5](https://github.com/arangodb/go-driver/tree/v1.6.5) (2024-11-15)
610
- Expose `NewType` method
711
- Switch to Go 1.22.8
812

9-
## [1.6.4(https://github.com/arangodb/go-driver/tree/v1.6.4) (2024-09-27)
13+
## [1.6.4](https://github.com/arangodb/go-driver/tree/v1.6.4) (2024-09-27)
1014
- Switch to Go 1.22.5
1115
- Switch to Go 1.22.6
1216

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SCRIPTDIR := $(shell pwd)
44
CURR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
55
ROOTDIR:=$(CURR)
66

7-
GOVERSION ?= 1.22.8
7+
GOVERSION ?= 1.22.11
88
GOIMAGE ?= golang:$(GOVERSION)
99
GOV2IMAGE ?= $(GOIMAGE)
1010
ALPINE_IMAGE ?= alpine:3.17

agency/agency.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2020-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2020-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -45,41 +45,49 @@ type Agency interface {
4545
***/
4646

4747
// Deprecated: TTL param is removed since 3.12, use WriteTransaction instead
48+
//
4849
// WriteKey writes the given value with the given key with a given TTL (unless TTL is zero).
4950
// If you pass a condition (only 1 allowed), this condition has to be true,
5051
// otherwise the write will fail with a ConditionFailed error.
5152
WriteKey(ctx context.Context, key []string, value interface{}, ttl time.Duration, condition ...WriteCondition) error
5253

5354
// Deprecated: use 'WriteTransaction' instead
55+
//
5456
// WriteKeyIfEmpty writes the given value with the given key only if the key was empty before.
5557
WriteKeyIfEmpty(ctx context.Context, key []string, value interface{}, ttl time.Duration) error
5658

5759
// Deprecated: use 'WriteTransaction' instead
60+
//
5861
// WriteKeyIfEqualTo writes the given new value with the given key only if the existing value for that key equals
5962
// to the given old value.
6063
WriteKeyIfEqualTo(ctx context.Context, key []string, newValue, oldValue interface{}, ttl time.Duration) error
6164

6265
// Deprecated: use 'WriteTransaction' instead
66+
//
6367
// RemoveKey removes the given key.
6468
// If you pass a condition (only 1 allowed), this condition has to be true,
6569
// otherwise the remove will fail with a ConditionFailed error.
6670
RemoveKey(ctx context.Context, key []string, condition ...WriteCondition) error
6771

6872
// Deprecated: use 'WriteTransaction' instead
73+
//
6974
// RemoveKeyIfEqualTo removes the given key only if the existing value for that key equals
7075
// to the given old value.
7176
RemoveKeyIfEqualTo(ctx context.Context, key []string, oldValue interface{}) error
7277

7378
// Deprecated: use 'WriteTransaction' instead
79+
//
7480
// Register a URL to receive notification callbacks when the value of the given key changes
7581
RegisterChangeCallback(ctx context.Context, key []string, cbURL string) error
7682

7783
// Deprecated: use 'WriteTransaction' instead
84+
//
7885
// Register a URL to receive notification callbacks when the value of the given key changes
7986
UnregisterChangeCallback(ctx context.Context, key []string, cbURL string) error
8087
}
8188

8289
// Deprecated: use 'agency.KeyConditioner' instead
90+
//
8391
// WriteCondition is a precondition before a write is accepted.
8492
type WriteCondition struct {
8593
conditions map[string]writeCondition
@@ -99,6 +107,7 @@ func (c WriteCondition) add(key []string, updater func(wc *writeCondition)) Writ
99107
}
100108

101109
// Deprecated: use 'agency.KeyConditioner' instead
110+
//
102111
// IfEmpty adds an "is empty" check on the given key to the given condition
103112
// and returns the updated condition.
104113
func (c WriteCondition) IfEmpty(key []string) WriteCondition {
@@ -108,6 +117,7 @@ func (c WriteCondition) IfEmpty(key []string) WriteCondition {
108117
}
109118

110119
// Deprecated: use 'agency.KeyConditioner' instead
120+
//
111121
// IfIsArray adds an "is-array" check on the given key to the given condition
112122
// and returns the updated condition.
113123
func (c WriteCondition) IfIsArray(key []string) WriteCondition {
@@ -117,6 +127,7 @@ func (c WriteCondition) IfIsArray(key []string) WriteCondition {
117127
}
118128

119129
// Deprecated: use 'agency.KeyConditioner' instead
130+
//
120131
// IfEqualTo adds an "value equals oldValue" check to given old value on the
121132
// given key to the given condition and returns the updated condition.
122133
func (c WriteCondition) IfEqualTo(key []string, oldValue interface{}) WriteCondition {

agency/agency_impl.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2020-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2020-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -143,6 +143,7 @@ type writeResult struct {
143143
}
144144

145145
// Deprecated: use 'WriteTransaction' instead
146+
//
146147
// WriteKey writes the given value with the given key with a given TTL (unless TTL is zero).
147148
// If you pass a condition (only 1 allowed), this condition has to be true,
148149
// otherwise the write will fail with a ConditionFailed error.
@@ -171,6 +172,7 @@ func (c *agency) WriteKey(ctx context.Context, key []string, value interface{},
171172
}
172173

173174
// Deprecated: use 'WriteTransaction' instead
175+
//
174176
// WriteKeyIfEmpty writes the given value with the given key only if the key was empty before.
175177
func (c *agency) WriteKeyIfEmpty(ctx context.Context, key []string, value interface{}, ttl time.Duration) error {
176178
transaction := NewTransaction("", TransactionOptions{})
@@ -185,6 +187,7 @@ func (c *agency) WriteKeyIfEmpty(ctx context.Context, key []string, value interf
185187
}
186188

187189
// Deprecated: use 'WriteTransaction' instead
190+
//
188191
// WriteKeyIfEqualTo writes the given new value with the given key only if the existing value for that key equals
189192
// to the given old value.
190193
func (c *agency) WriteKeyIfEqualTo(ctx context.Context, key []string, newValue, oldValue interface{}, ttl time.Duration) error {
@@ -281,6 +284,7 @@ func (c *agency) WriteTransaction(ctx context.Context, transaction Transaction)
281284
}
282285

283286
// Deprecated: use 'WriteTransaction' instead
287+
//
284288
// RemoveKey removes the given key.
285289
// If you pass a condition (only 1 allowed), this condition has to be true,
286290
// otherwise the remove will fail with a ConditionFailed error.
@@ -310,6 +314,7 @@ func (c *agency) RemoveKey(ctx context.Context, key []string, condition ...Write
310314
}
311315

312316
// Deprecated: use 'WriteTransaction' instead
317+
//
313318
// RemoveKeyIfEqualTo removes the given key only if the existing value for that key equals
314319
// to the given old value.
315320
func (c *agency) RemoveKeyIfEqualTo(ctx context.Context, key []string, oldValue interface{}) error {
@@ -325,6 +330,7 @@ func (c *agency) RemoveKeyIfEqualTo(ctx context.Context, key []string, oldValue
325330
}
326331

327332
// Deprecated: use 'WriteTransaction' instead
333+
//
328334
// Register a URL to receive notification callbacks when the value of the given key changes
329335
func (c *agency) RegisterChangeCallback(ctx context.Context, key []string, cbURL string) error {
330336
transaction := NewTransaction("", TransactionOptions{})
@@ -338,6 +344,7 @@ func (c *agency) RegisterChangeCallback(ctx context.Context, key []string, cbURL
338344
}
339345

340346
// Deprecated: use 'WriteTransaction' instead
347+
//
341348
// Register a URL to receive notification callbacks when the value of the given key changes
342349
func (c *agency) UnregisterChangeCallback(ctx context.Context, key []string, cbURL string) error {
343350

agency/operation.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2020-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2020-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@ type KeyChanger interface {
3838
GetVal() interface{}
3939

4040
// Deprecated: removed since 3.12
41+
//
4142
// GetTTL returns how long (in seconds) a key will live in the agency
4243
GetTTL() time.Duration
4344
}
@@ -113,6 +114,7 @@ func NewKeySetV2(key []string, value interface{}) KeyChanger {
113114
}
114115

115116
// NewKeySet returns a new key operation which must be set in the agency
117+
//
116118
// Deprecated: TTL param is removed since 3.12, use NewKeySetV2 instead
117119
func NewKeySet(key []string, value interface{}, TTL time.Duration) KeyChanger {
118120
return &keySet{
@@ -127,6 +129,7 @@ func NewKeySet(key []string, value interface{}, TTL time.Duration) KeyChanger {
127129
// NewKeyObserve returns a new key callback operation which must be written in the agency.
128130
// URL parameter describes where callback must be sent in case of changes on a key.
129131
// When 'observe' is false then we want to stop observing a key.
132+
//
130133
// Deprecated: observe param is removed since 3.12
131134
func NewKeyObserve(key []string, URL string, observe bool) KeyChanger {
132135
return &keyObserve{

client.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -114,6 +114,7 @@ type ClientConfig struct {
114114
Authentication Authentication
115115

116116
// Deprecated: using non-zero duration causes routine leak. Please create your own implementation using Client.SynchronizeEndpoints2
117+
//
117118
// SynchronizeEndpointsInterval is the interval between automatic synchronization of endpoints.
118119
// If this value is 0, no automatic synchronization is performed.
119120
// If this value is > 0, automatic synchronization is started on a go routine.

client_admin_backup.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@ type BackupCreateOptions struct {
6262

6363
Timeout time.Duration `json:"timeout,omitempty"`
6464

65-
// @deprecated - since 3.10.10 it exists only for backwards compatibility
65+
// Deprecated: - since 3.10.10 it exists only for backwards compatibility
6666
AllowInconsistent bool `json:"allowInconsistent,omitempty"`
6767
}
6868

client_impl.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -107,6 +107,7 @@ func (c *client) SynchronizeEndpoints2(ctx context.Context, dbname string) error
107107
}
108108

109109
// Deprecated: should not be called in new code.
110+
//
110111
// autoSynchronizeEndpoints performs automatic endpoint synchronization.
111112
func (c *client) autoSynchronizeEndpoints(interval time.Duration) {
112113
for {

client_server_admin.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -56,6 +56,7 @@ type ClientServerAdmin interface {
5656
MetricsForSingleServer(ctx context.Context, serverID string) ([]byte, error)
5757

5858
// Deprecated: Use Metrics instead.
59+
//
5960
// Statistics queries statistics from a specific server
6061
Statistics(ctx context.Context) (ServerStatistics, error)
6162

collection_indexes.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ type CollectionIndexes interface {
3535
Indexes(ctx context.Context) ([]Index, error)
3636

3737
// Deprecated: since 3.10 version. Use ArangoSearch view instead.
38+
//
3839
// EnsureFullTextIndex creates a fulltext index in the collection, if it does not already exist.
3940
// Fields is a slice of attribute names. Currently, the slice is limited to exactly one attribute.
4041
// The index is returned, together with a boolean indicating if the index was newly created (true) or pre-existing (false).
@@ -90,6 +91,7 @@ type CollectionIndexes interface {
9091
}
9192

9293
// Deprecated: since 3.10 version. Use ArangoSearch view instead.
94+
//
9395
// EnsureFullTextIndexOptions contains specific options for creating a full text index.
9496
type EnsureFullTextIndexOptions struct {
9597
// MinLength is the minimum character length of words to index. Will default to a server-defined

collection_indexes_impl.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -138,6 +138,7 @@ func (c *collection) Indexes(ctx context.Context) ([]Index, error) {
138138
}
139139

140140
// Deprecated: since 3.10 version. Use ArangoSearch view instead.
141+
//
141142
// EnsureFullTextIndex creates a fulltext index in the collection, if it does not already exist.
142143
//
143144
// Fields is a slice of attribute names. Currently, the slice is limited to exactly one attribute.

database_arangosearch_analyzers.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2018-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -50,6 +50,7 @@ type ArangoSearchAnalyzer interface {
5050
type DatabaseArangoSearchAnalyzers interface {
5151

5252
// Deprecated: Use EnsureCreatedAnalyzer instead
53+
//
5354
// Ensure ensures that the given analyzer exists. If it does not exist it is created.
5455
// The function returns whether the analyzer already existed or an error.
5556
EnsureAnalyzer(ctx context.Context, analyzer ArangoSearchAnalyzerDefinition) (bool, ArangoSearchAnalyzer, error)

database_arangosearch_analyzers_impl.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2018-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -92,6 +92,7 @@ func (a *analyzer) Database() Database {
9292
}
9393

9494
// Deprecated: Use EnsureCreatedAnalyzer instead
95+
//
9596
// Ensure ensures that the given analyzer exists. If it does not exist it is created.
9697
// The function returns whether the analyzer already existed or an error.
9798
func (d *database) EnsureAnalyzer(ctx context.Context, definition ArangoSearchAnalyzerDefinition) (bool, ArangoSearchAnalyzer, error) {

database_collections.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -177,6 +177,7 @@ type CollectionKeyOptions struct {
177177
// If set to true, then it is allowed to supply own key values in the _key attribute of a document.
178178
// If set to false, then the key generator will solely be responsible for generating keys and supplying own
179179
// key values in the _key attribute of documents is considered an error.
180+
//
180181
// Deprecated: Use AllowUserKeysPtr instead
181182
AllowUserKeys bool `json:"-"`
182183
// If set to true, then it is allowed to supply own key values in the _key attribute of a document.

database_graphs.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@ type DatabaseGraphs interface {
4242

4343
// CreateGraph creates a new graph with given name and options, and opens a connection to it.
4444
// If a graph with given name already exists within the database, a DuplicateError is returned.
45+
//
4546
// Deprecated: since ArangoDB 3.9 - please use CreateGraphV2 instead
4647
CreateGraph(ctx context.Context, name string, options *CreateGraphOptions) (Graph, error)
4748

0 commit comments

Comments
 (0)