chore(deps): bump google.golang.org/api from 0.140.0 to 0.141.0 (#2748)

Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.140.0 to 0.141.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.140.0...v0.141.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2023-09-18 10:53:18 -07:00 committed by GitHub
parent a861fadeba
commit ce093cb8ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 1482 additions and 3733 deletions

2
go.mod
View File

@ -149,7 +149,7 @@ require (
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.1.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.140.0
google.golang.org/api v0.141.0
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/grpc v1.57.0 // indirect

4
go.sum
View File

@ -1005,8 +1005,8 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8=
google.golang.org/api v0.140.0 h1:CaXNdYOH5oQQI7l6iKTHHiMTdxZca4/02hRg2U8c2hM=
google.golang.org/api v0.140.0/go.mod h1:aGbCiFgtwb2P6badchFbSBUurV6oR5d50Af4iNJtDdI=
google.golang.org/api v0.141.0 h1:Df6vfMgDoIM6ss0m7H4MPwFwY87WNXHfBIda/Bmfl4E=
google.golang.org/api v0.141.0/go.mod h1:iZqLkdPlXKyG0b90eu6KxVSE4D/ccRF2e/doKD2CnQQ=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=

View File

@ -78,9 +78,8 @@ const (
// met:
//
// (1) At least one of the following is true:
// (a) No scope is provided
// (b) Scope for self-signed JWT flow is enabled
// (c) Audiences are explicitly provided by users
// (a) Scope for self-signed JWT flow is enabled
// (b) Audiences are explicitly provided by users
// (2) No service account impersontation
//
// - Otherwise, executes standard OAuth 2.0 flow

View File

@ -5,4 +5,4 @@
package internal
// Version is the current tagged release of the library.
const Version = "0.140.0"
const Version = "0.141.0"

View File

@ -26,7 +26,7 @@
"description": "Stores and retrieves potentially large, immutable data objects.",
"discoveryVersion": "v1",
"documentationLink": "https://developers.google.com/storage/docs/json_api/",
"etag": "\"39353535313838393033333032363632303533\"",
"etag": "\"3137393534363837313035303430333138303233\"",
"icons": {
"x16": "https://www.google.com/images/icons/product/cloud_storage-16.png",
"x32": "https://www.google.com/images/icons/product/cloud_storage-32.png"
@ -1572,6 +1572,34 @@
},
"objects": {
"methods": {
"bulkRestore": {
"description": "Initiates a long-running bulk restore operation on the specified bucket.",
"httpMethod": "POST",
"id": "storage.objects.bulkRestore",
"parameterOrder": [
"bucket"
],
"parameters": {
"bucket": {
"description": "Name of the bucket in which the object resides.",
"location": "path",
"required": true,
"type": "string"
}
},
"path": "b/{bucket}/o/bulkRestore",
"request": {
"$ref": "BulkRestoreObjectsRequest"
},
"response": {
"$ref": "GoogleLongrunningOperation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_write"
]
},
"compose": {
"description": "Concatenates a list of existing objects into a new object in the same bucket.",
"httpMethod": "POST",
@ -1925,6 +1953,11 @@
"location": "query",
"type": "string"
},
"softDeleted": {
"description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.",
"location": "query",
"type": "boolean"
},
"userProject": {
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
"location": "query",
@ -2177,6 +2210,11 @@
"location": "query",
"type": "string"
},
"softDeleted": {
"description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.",
"location": "query",
"type": "boolean"
},
"startOffset": {
"description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).",
"location": "query",
@ -2309,6 +2347,89 @@
"https://www.googleapis.com/auth/devstorage.full_control"
]
},
"restore": {
"description": "Restores a soft-deleted object.",
"httpMethod": "POST",
"id": "storage.objects.restore",
"parameterOrder": [
"bucket",
"object"
],
"parameters": {
"bucket": {
"description": "Name of the bucket in which the object resides.",
"location": "path",
"required": true,
"type": "string"
},
"generation": {
"description": "Selects a specific revision of this object.",
"format": "int64",
"location": "query",
"required": true,
"type": "string"
},
"ifGenerationMatch": {
"description": "Makes the operation conditional on whether the object's one live generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
"format": "int64",
"location": "query",
"type": "string"
},
"ifGenerationNotMatch": {
"description": "Makes the operation conditional on whether none of the object's live generations match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
"format": "int64",
"location": "query",
"type": "string"
},
"ifMetagenerationMatch": {
"description": "Makes the operation conditional on whether the object's one live metageneration matches the given value.",
"format": "int64",
"location": "query",
"type": "string"
},
"ifMetagenerationNotMatch": {
"description": "Makes the operation conditional on whether none of the object's live metagenerations match the given value.",
"format": "int64",
"location": "query",
"type": "string"
},
"object": {
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
"location": "path",
"required": true,
"type": "string"
},
"projection": {
"description": "Set of properties to return. Defaults to full.",
"enum": [
"full",
"noAcl"
],
"enumDescriptions": [
"Include all properties.",
"Omit the owner, acl property."
],
"location": "query",
"type": "string"
},
"userProject": {
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
"location": "query",
"type": "string"
}
},
"path": "b/{bucket}/o/{object}/restore",
"request": {
"$ref": "Object"
},
"response": {
"$ref": "Object"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control"
]
},
"rewrite": {
"description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
"httpMethod": "POST",
@ -2764,6 +2885,117 @@
}
}
},
"operations": {
"methods": {
"cancel": {
"description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed.",
"httpMethod": "POST",
"id": "storage.buckets.operations.cancel",
"parameterOrder": [
"bucket",
"operationId"
],
"parameters": {
"bucket": {
"description": "The parent bucket of the operation resource.",
"location": "path",
"required": true,
"type": "string"
},
"operationId": {
"description": "The ID of the operation resource.",
"location": "path",
"required": true,
"type": "string"
}
},
"path": "b/{bucket}/operations/{operationId}/cancel",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_write"
]
},
"get": {
"description": "Gets the latest state of a long-running operation.",
"httpMethod": "GET",
"id": "storage.buckets.operations.get",
"parameterOrder": [
"bucket",
"operationId"
],
"parameters": {
"bucket": {
"description": "The parent bucket of the operation resource.",
"location": "path",
"required": true,
"type": "string"
},
"operationId": {
"description": "The ID of the operation resource.",
"location": "path",
"required": true,
"type": "string"
}
},
"path": "b/{bucket}/operations/{operationId}",
"response": {
"$ref": "GoogleLongrunningOperation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/devstorage.read_write"
]
},
"list": {
"description": "Lists operations that match the specified filter in the request.",
"httpMethod": "GET",
"id": "storage.buckets.operations.list",
"parameterOrder": [
"bucket"
],
"parameters": {
"bucket": {
"description": "Name of the bucket in which to look for operations.",
"location": "path",
"required": true,
"type": "string"
},
"filter": {
"description": "A filter to narrow down results to a preferred subset. The filtering language is documented in more detail in [AIP-160](https://google.aip.dev/160).",
"location": "query",
"type": "string"
},
"pageSize": {
"description": "Maximum number of items to return in a single page of responses. Fewer total results may be returned than requested. The service uses this parameter or 100 items, whichever is smaller.",
"format": "int32",
"location": "query",
"minimum": "0",
"type": "integer"
},
"pageToken": {
"description": "A previously-returned page token representing part of the larger set of results to view.",
"location": "query",
"type": "string"
}
},
"path": "b/{bucket}/operations",
"response": {
"$ref": "GoogleLongrunningListOperationsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/devstorage.read_write"
]
}
}
},
"projects": {
"resources": {
"hmacKeys": {
@ -3010,7 +3242,7 @@
}
}
},
"revision": "20230710",
"revision": "20230907",
"rootUrl": "https://storage.googleapis.com/",
"schemas": {
"Bucket": {
@ -3525,6 +3757,38 @@
},
"type": "object"
},
"BulkRestoreObjectsRequest": {
"description": "A bulk restore objects request.",
"id": "BulkRestoreObjectsRequest",
"properties": {
"allowOverwrite": {
"description": "If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue.",
"type": "boolean"
},
"copySourceAcl": {
"description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.",
"type": "boolean"
},
"matchGlobs": {
"description": "Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.",
"items": {
"type": "string"
},
"type": "array"
},
"softDeletedAfterTime": {
"description": "Restores only the objects that were soft-deleted after this time.",
"format": "date-time",
"type": "string"
},
"softDeletedBeforeTime": {
"description": "Restores only the objects that were soft-deleted before this time.",
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
"Channel": {
"description": "An notification channel used to watch for resource changes.",
"id": "Channel",
@ -3656,6 +3920,86 @@
},
"type": "object"
},
"GoogleLongrunningListOperationsResponse": {
"description": "The response message for storage.buckets.operations.list.",
"id": "GoogleLongrunningListOperationsResponse",
"properties": {
"nextPageToken": {
"description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.",
"type": "string"
},
"operations": {
"description": "A list of operations that matches the specified filter in the request.",
"items": {
"$ref": "GoogleLongrunningOperation"
},
"type": "array"
}
},
"type": "object"
},
"GoogleLongrunningOperation": {
"description": "This resource represents a long-running operation that is the result of a network API call.",
"id": "GoogleLongrunningOperation",
"properties": {
"done": {
"description": "If the value is \"false\", it means the operation is still in progress. If \"true\", the operation is completed, and either \"error\" or \"response\" is available.",
"type": "boolean"
},
"error": {
"$ref": "GoogleRpcStatus",
"description": "The error result of the operation in case of failure or cancellation."
},
"metadata": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
"type": "object"
},
"name": {
"description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the \"name\" should be a resource name ending with \"operations/{operationId}\".",
"type": "string"
},
"response": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"description": "The normal response of the operation in case of success. If the original method returns no data on success, such as \"Delete\", the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type \"XxxResponse\", where \"Xxx\" is the original method name. For example, if the original method name is \"TakeSnapshot()\", the inferred response type is \"TakeSnapshotResponse\".",
"type": "object"
}
},
"type": "object"
},
"GoogleRpcStatus": {
"description": "The \"Status\" type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each \"Status\" message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
"id": "GoogleRpcStatus",
"properties": {
"code": {
"description": "The status code, which should be an enum value of google.rpc.Code.",
"format": "int32",
"type": "integer"
},
"details": {
"description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
"items": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"type": "object"
},
"type": "array"
},
"message": {
"description": "A developer-facing error message, which should be in English.",
"type": "string"
}
},
"type": "object"
},
"HmacKey": {
"description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.",
"id": "HmacKey",

File diff suppressed because it is too large Load Diff

View File

@ -35,9 +35,6 @@ const disableDirectPath = "GOOGLE_CLOUD_DISABLE_DIRECT_PATH"
// Check env to decide if using google-c2p resolver for DirectPath traffic.
const enableDirectPathXds = "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
// Set at init time by dial_appengine.go. If nil, we're not on App Engine.
var appengineDialerHook func(context.Context) grpc.DialOption
// Set at init time by dial_socketopt.go. If nil, socketopt is not supported.
var timeoutDialerOption grpc.DialOption
@ -186,12 +183,6 @@ func dial(ctx context.Context, insecure bool, o *internal.DialSettings) (*grpc.C
}
}
if appengineDialerHook != nil {
// Use the Socket API on App Engine.
// appengine dialer will override socketopt dialer
grpcOpts = append(grpcOpts, appengineDialerHook(ctx))
}
// Add tracing, but before the other options, so that clients can override the
// gRPC stats handler.
// This assumes that gRPC options are processed in order, left to right.

View File

@ -1,32 +0,0 @@
// Copyright 2016 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build appengine
// +build appengine
package grpc
import (
"context"
"net"
"time"
"google.golang.org/appengine"
"google.golang.org/appengine/socket"
"google.golang.org/grpc"
)
func init() {
// NOTE: dev_appserver doesn't currently support SSL.
// When it does, this code can be removed.
if appengine.IsDevAppServer() {
return
}
appengineDialerHook = func(ctx context.Context) grpc.DialOption {
return grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
return socket.DialTimeout(ctx, "tcp", addr, timeout)
})
}
}

View File

@ -145,22 +145,13 @@ func (t *parameterTransport) RoundTrip(req *http.Request) (*http.Response, error
return rt.RoundTrip(&newReq)
}
// Set at init time by dial_appengine.go. If nil, we're not on App Engine.
var appengineUrlfetchHook func(context.Context) http.RoundTripper
// defaultBaseTransport returns the base HTTP transport.
// On App Engine, this is urlfetch.Transport.
// Otherwise, use a default transport, taking most defaults from
// http.DefaultTransport.
// defaultBaseTransport returns the base HTTP transport. It uses a default
// transport, taking most defaults from http.DefaultTransport.
// If TLSCertificate is available, set TLSClientConfig as well.
func defaultBaseTransport(ctx context.Context, clientCertSource cert.Source, dialTLSContext func(context.Context, string, string) (net.Conn, error)) http.RoundTripper {
if appengineUrlfetchHook != nil {
return appengineUrlfetchHook(ctx)
}
// Copy http.DefaultTransport except for MaxIdleConnsPerHost setting,
// which is increased due to reported performance issues under load in the GCS
// client. Transport.Clone is only available in Go 1.13 and up.
// which is increased due to reported performance issues under load in the
// GCS client. Transport.Clone is only available in Go 1.13 and up.
trans := clonedTransport(http.DefaultTransport)
if trans == nil {
trans = fallbackBaseTransport()

View File

@ -1,21 +0,0 @@
// Copyright 2016 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build appengine
// +build appengine
package http
import (
"context"
"net/http"
"google.golang.org/appengine/urlfetch"
)
func init() {
appengineUrlfetchHook = func(ctx context.Context) http.RoundTripper {
return &urlfetch.Transport{Context: ctx}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,460 +0,0 @@
syntax = "proto2";
option go_package = "socket";
package appengine;
message RemoteSocketServiceError {
enum ErrorCode {
SYSTEM_ERROR = 1;
GAI_ERROR = 2;
FAILURE = 4;
PERMISSION_DENIED = 5;
INVALID_REQUEST = 6;
SOCKET_CLOSED = 7;
}
enum SystemError {
option allow_alias = true;
SYS_SUCCESS = 0;
SYS_EPERM = 1;
SYS_ENOENT = 2;
SYS_ESRCH = 3;
SYS_EINTR = 4;
SYS_EIO = 5;
SYS_ENXIO = 6;
SYS_E2BIG = 7;
SYS_ENOEXEC = 8;
SYS_EBADF = 9;
SYS_ECHILD = 10;
SYS_EAGAIN = 11;
SYS_EWOULDBLOCK = 11;
SYS_ENOMEM = 12;
SYS_EACCES = 13;
SYS_EFAULT = 14;
SYS_ENOTBLK = 15;
SYS_EBUSY = 16;
SYS_EEXIST = 17;
SYS_EXDEV = 18;
SYS_ENODEV = 19;
SYS_ENOTDIR = 20;
SYS_EISDIR = 21;
SYS_EINVAL = 22;
SYS_ENFILE = 23;
SYS_EMFILE = 24;
SYS_ENOTTY = 25;
SYS_ETXTBSY = 26;
SYS_EFBIG = 27;
SYS_ENOSPC = 28;
SYS_ESPIPE = 29;
SYS_EROFS = 30;
SYS_EMLINK = 31;
SYS_EPIPE = 32;
SYS_EDOM = 33;
SYS_ERANGE = 34;
SYS_EDEADLK = 35;
SYS_EDEADLOCK = 35;
SYS_ENAMETOOLONG = 36;
SYS_ENOLCK = 37;
SYS_ENOSYS = 38;
SYS_ENOTEMPTY = 39;
SYS_ELOOP = 40;
SYS_ENOMSG = 42;
SYS_EIDRM = 43;
SYS_ECHRNG = 44;
SYS_EL2NSYNC = 45;
SYS_EL3HLT = 46;
SYS_EL3RST = 47;
SYS_ELNRNG = 48;
SYS_EUNATCH = 49;
SYS_ENOCSI = 50;
SYS_EL2HLT = 51;
SYS_EBADE = 52;
SYS_EBADR = 53;
SYS_EXFULL = 54;
SYS_ENOANO = 55;
SYS_EBADRQC = 56;
SYS_EBADSLT = 57;
SYS_EBFONT = 59;
SYS_ENOSTR = 60;
SYS_ENODATA = 61;
SYS_ETIME = 62;
SYS_ENOSR = 63;
SYS_ENONET = 64;
SYS_ENOPKG = 65;
SYS_EREMOTE = 66;
SYS_ENOLINK = 67;
SYS_EADV = 68;
SYS_ESRMNT = 69;
SYS_ECOMM = 70;
SYS_EPROTO = 71;
SYS_EMULTIHOP = 72;
SYS_EDOTDOT = 73;
SYS_EBADMSG = 74;
SYS_EOVERFLOW = 75;
SYS_ENOTUNIQ = 76;
SYS_EBADFD = 77;
SYS_EREMCHG = 78;
SYS_ELIBACC = 79;
SYS_ELIBBAD = 80;
SYS_ELIBSCN = 81;
SYS_ELIBMAX = 82;
SYS_ELIBEXEC = 83;
SYS_EILSEQ = 84;
SYS_ERESTART = 85;
SYS_ESTRPIPE = 86;
SYS_EUSERS = 87;
SYS_ENOTSOCK = 88;
SYS_EDESTADDRREQ = 89;
SYS_EMSGSIZE = 90;
SYS_EPROTOTYPE = 91;
SYS_ENOPROTOOPT = 92;
SYS_EPROTONOSUPPORT = 93;
SYS_ESOCKTNOSUPPORT = 94;
SYS_EOPNOTSUPP = 95;
SYS_ENOTSUP = 95;
SYS_EPFNOSUPPORT = 96;
SYS_EAFNOSUPPORT = 97;
SYS_EADDRINUSE = 98;
SYS_EADDRNOTAVAIL = 99;
SYS_ENETDOWN = 100;
SYS_ENETUNREACH = 101;
SYS_ENETRESET = 102;
SYS_ECONNABORTED = 103;
SYS_ECONNRESET = 104;
SYS_ENOBUFS = 105;
SYS_EISCONN = 106;
SYS_ENOTCONN = 107;
SYS_ESHUTDOWN = 108;
SYS_ETOOMANYREFS = 109;
SYS_ETIMEDOUT = 110;
SYS_ECONNREFUSED = 111;
SYS_EHOSTDOWN = 112;
SYS_EHOSTUNREACH = 113;
SYS_EALREADY = 114;
SYS_EINPROGRESS = 115;
SYS_ESTALE = 116;
SYS_EUCLEAN = 117;
SYS_ENOTNAM = 118;
SYS_ENAVAIL = 119;
SYS_EISNAM = 120;
SYS_EREMOTEIO = 121;
SYS_EDQUOT = 122;
SYS_ENOMEDIUM = 123;
SYS_EMEDIUMTYPE = 124;
SYS_ECANCELED = 125;
SYS_ENOKEY = 126;
SYS_EKEYEXPIRED = 127;
SYS_EKEYREVOKED = 128;
SYS_EKEYREJECTED = 129;
SYS_EOWNERDEAD = 130;
SYS_ENOTRECOVERABLE = 131;
SYS_ERFKILL = 132;
}
optional int32 system_error = 1 [default=0];
optional string error_detail = 2;
}
message AddressPort {
required int32 port = 1;
optional bytes packed_address = 2;
optional string hostname_hint = 3;
}
message CreateSocketRequest {
enum SocketFamily {
IPv4 = 1;
IPv6 = 2;
}
enum SocketProtocol {
TCP = 1;
UDP = 2;
}
required SocketFamily family = 1;
required SocketProtocol protocol = 2;
repeated SocketOption socket_options = 3;
optional AddressPort proxy_external_ip = 4;
optional int32 listen_backlog = 5 [default=0];
optional AddressPort remote_ip = 6;
optional string app_id = 9;
optional int64 project_id = 10;
}
message CreateSocketReply {
optional string socket_descriptor = 1;
optional AddressPort server_address = 3;
optional AddressPort proxy_external_ip = 4;
extensions 1000 to max;
}
message BindRequest {
required string socket_descriptor = 1;
required AddressPort proxy_external_ip = 2;
}
message BindReply {
optional AddressPort proxy_external_ip = 1;
}
message GetSocketNameRequest {
required string socket_descriptor = 1;
}
message GetSocketNameReply {
optional AddressPort proxy_external_ip = 2;
}
message GetPeerNameRequest {
required string socket_descriptor = 1;
}
message GetPeerNameReply {
optional AddressPort peer_ip = 2;
}
message SocketOption {
enum SocketOptionLevel {
SOCKET_SOL_IP = 0;
SOCKET_SOL_SOCKET = 1;
SOCKET_SOL_TCP = 6;
SOCKET_SOL_UDP = 17;
}
enum SocketOptionName {
option allow_alias = true;
SOCKET_SO_DEBUG = 1;
SOCKET_SO_REUSEADDR = 2;
SOCKET_SO_TYPE = 3;
SOCKET_SO_ERROR = 4;
SOCKET_SO_DONTROUTE = 5;
SOCKET_SO_BROADCAST = 6;
SOCKET_SO_SNDBUF = 7;
SOCKET_SO_RCVBUF = 8;
SOCKET_SO_KEEPALIVE = 9;
SOCKET_SO_OOBINLINE = 10;
SOCKET_SO_LINGER = 13;
SOCKET_SO_RCVTIMEO = 20;
SOCKET_SO_SNDTIMEO = 21;
SOCKET_IP_TOS = 1;
SOCKET_IP_TTL = 2;
SOCKET_IP_HDRINCL = 3;
SOCKET_IP_OPTIONS = 4;
SOCKET_TCP_NODELAY = 1;
SOCKET_TCP_MAXSEG = 2;
SOCKET_TCP_CORK = 3;
SOCKET_TCP_KEEPIDLE = 4;
SOCKET_TCP_KEEPINTVL = 5;
SOCKET_TCP_KEEPCNT = 6;
SOCKET_TCP_SYNCNT = 7;
SOCKET_TCP_LINGER2 = 8;
SOCKET_TCP_DEFER_ACCEPT = 9;
SOCKET_TCP_WINDOW_CLAMP = 10;
SOCKET_TCP_INFO = 11;
SOCKET_TCP_QUICKACK = 12;
}
required SocketOptionLevel level = 1;
required SocketOptionName option = 2;
required bytes value = 3;
}
message SetSocketOptionsRequest {
required string socket_descriptor = 1;
repeated SocketOption options = 2;
}
message SetSocketOptionsReply {
}
message GetSocketOptionsRequest {
required string socket_descriptor = 1;
repeated SocketOption options = 2;
}
message GetSocketOptionsReply {
repeated SocketOption options = 2;
}
message ConnectRequest {
required string socket_descriptor = 1;
required AddressPort remote_ip = 2;
optional double timeout_seconds = 3 [default=-1];
}
message ConnectReply {
optional AddressPort proxy_external_ip = 1;
extensions 1000 to max;
}
message ListenRequest {
required string socket_descriptor = 1;
required int32 backlog = 2;
}
message ListenReply {
}
message AcceptRequest {
required string socket_descriptor = 1;
optional double timeout_seconds = 2 [default=-1];
}
message AcceptReply {
optional bytes new_socket_descriptor = 2;
optional AddressPort remote_address = 3;
}
message ShutDownRequest {
enum How {
SOCKET_SHUT_RD = 1;
SOCKET_SHUT_WR = 2;
SOCKET_SHUT_RDWR = 3;
}
required string socket_descriptor = 1;
required How how = 2;
required int64 send_offset = 3;
}
message ShutDownReply {
}
message CloseRequest {
required string socket_descriptor = 1;
optional int64 send_offset = 2 [default=-1];
}
message CloseReply {
}
message SendRequest {
required string socket_descriptor = 1;
required bytes data = 2 [ctype=CORD];
required int64 stream_offset = 3;
optional int32 flags = 4 [default=0];
optional AddressPort send_to = 5;
optional double timeout_seconds = 6 [default=-1];
}
message SendReply {
optional int32 data_sent = 1;
}
message ReceiveRequest {
enum Flags {
MSG_OOB = 1;
MSG_PEEK = 2;
}
required string socket_descriptor = 1;
required int32 data_size = 2;
optional int32 flags = 3 [default=0];
optional double timeout_seconds = 5 [default=-1];
}
message ReceiveReply {
optional int64 stream_offset = 2;
optional bytes data = 3 [ctype=CORD];
optional AddressPort received_from = 4;
optional int32 buffer_size = 5;
}
message PollEvent {
enum PollEventFlag {
SOCKET_POLLNONE = 0;
SOCKET_POLLIN = 1;
SOCKET_POLLPRI = 2;
SOCKET_POLLOUT = 4;
SOCKET_POLLERR = 8;
SOCKET_POLLHUP = 16;
SOCKET_POLLNVAL = 32;
SOCKET_POLLRDNORM = 64;
SOCKET_POLLRDBAND = 128;
SOCKET_POLLWRNORM = 256;
SOCKET_POLLWRBAND = 512;
SOCKET_POLLMSG = 1024;
SOCKET_POLLREMOVE = 4096;
SOCKET_POLLRDHUP = 8192;
};
required string socket_descriptor = 1;
required int32 requested_events = 2;
required int32 observed_events = 3;
}
message PollRequest {
repeated PollEvent events = 1;
optional double timeout_seconds = 2 [default=-1];
}
message PollReply {
repeated PollEvent events = 2;
}
message ResolveRequest {
required string name = 1;
repeated CreateSocketRequest.SocketFamily address_families = 2;
}
message ResolveReply {
enum ErrorCode {
SOCKET_EAI_ADDRFAMILY = 1;
SOCKET_EAI_AGAIN = 2;
SOCKET_EAI_BADFLAGS = 3;
SOCKET_EAI_FAIL = 4;
SOCKET_EAI_FAMILY = 5;
SOCKET_EAI_MEMORY = 6;
SOCKET_EAI_NODATA = 7;
SOCKET_EAI_NONAME = 8;
SOCKET_EAI_SERVICE = 9;
SOCKET_EAI_SOCKTYPE = 10;
SOCKET_EAI_SYSTEM = 11;
SOCKET_EAI_BADHINTS = 12;
SOCKET_EAI_PROTOCOL = 13;
SOCKET_EAI_OVERFLOW = 14;
SOCKET_EAI_MAX = 15;
};
repeated bytes packed_address = 2;
optional string canonical_name = 3;
repeated string aliases = 4;
}

View File

@ -1,10 +0,0 @@
// Copyright 2012 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Package socket provides outbound network sockets.
//
// This package is only required in the classic App Engine environment.
// Applications running only in App Engine "flexible environment" should
// use the standard library's net package.
package socket

View File

@ -1,290 +0,0 @@
// Copyright 2012 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// +build appengine
package socket
import (
"fmt"
"io"
"net"
"strconv"
"time"
"github.com/golang/protobuf/proto"
"golang.org/x/net/context"
"google.golang.org/appengine/internal"
pb "google.golang.org/appengine/internal/socket"
)
// Dial connects to the address addr on the network protocol.
// The address format is host:port, where host may be a hostname or an IP address.
// Known protocols are "tcp" and "udp".
// The returned connection satisfies net.Conn, and is valid while ctx is valid;
// if the connection is to be used after ctx becomes invalid, invoke SetContext
// with the new context.
func Dial(ctx context.Context, protocol, addr string) (*Conn, error) {
return DialTimeout(ctx, protocol, addr, 0)
}
var ipFamilies = []pb.CreateSocketRequest_SocketFamily{
pb.CreateSocketRequest_IPv4,
pb.CreateSocketRequest_IPv6,
}
// DialTimeout is like Dial but takes a timeout.
// The timeout includes name resolution, if required.
func DialTimeout(ctx context.Context, protocol, addr string, timeout time.Duration) (*Conn, error) {
dialCtx := ctx // Used for dialing and name resolution, but not stored in the *Conn.
if timeout > 0 {
var cancel context.CancelFunc
dialCtx, cancel = context.WithTimeout(ctx, timeout)
defer cancel()
}
host, portStr, err := net.SplitHostPort(addr)
if err != nil {
return nil, err
}
port, err := strconv.Atoi(portStr)
if err != nil {
return nil, fmt.Errorf("socket: bad port %q: %v", portStr, err)
}
var prot pb.CreateSocketRequest_SocketProtocol
switch protocol {
case "tcp":
prot = pb.CreateSocketRequest_TCP
case "udp":
prot = pb.CreateSocketRequest_UDP
default:
return nil, fmt.Errorf("socket: unknown protocol %q", protocol)
}
packedAddrs, resolved, err := resolve(dialCtx, ipFamilies, host)
if err != nil {
return nil, fmt.Errorf("socket: failed resolving %q: %v", host, err)
}
if len(packedAddrs) == 0 {
return nil, fmt.Errorf("no addresses for %q", host)
}
packedAddr := packedAddrs[0] // use first address
fam := pb.CreateSocketRequest_IPv4
if len(packedAddr) == net.IPv6len {
fam = pb.CreateSocketRequest_IPv6
}
req := &pb.CreateSocketRequest{
Family: fam.Enum(),
Protocol: prot.Enum(),
RemoteIp: &pb.AddressPort{
Port: proto.Int32(int32(port)),
PackedAddress: packedAddr,
},
}
if resolved {
req.RemoteIp.HostnameHint = &host
}
res := &pb.CreateSocketReply{}
if err := internal.Call(dialCtx, "remote_socket", "CreateSocket", req, res); err != nil {
return nil, err
}
return &Conn{
ctx: ctx,
desc: res.GetSocketDescriptor(),
prot: prot,
local: res.ProxyExternalIp,
remote: req.RemoteIp,
}, nil
}
// LookupIP returns the given host's IP addresses.
func LookupIP(ctx context.Context, host string) (addrs []net.IP, err error) {
packedAddrs, _, err := resolve(ctx, ipFamilies, host)
if err != nil {
return nil, fmt.Errorf("socket: failed resolving %q: %v", host, err)
}
addrs = make([]net.IP, len(packedAddrs))
for i, pa := range packedAddrs {
addrs[i] = net.IP(pa)
}
return addrs, nil
}
func resolve(ctx context.Context, fams []pb.CreateSocketRequest_SocketFamily, host string) ([][]byte, bool, error) {
// Check if it's an IP address.
if ip := net.ParseIP(host); ip != nil {
if ip := ip.To4(); ip != nil {
return [][]byte{ip}, false, nil
}
return [][]byte{ip}, false, nil
}
req := &pb.ResolveRequest{
Name: &host,
AddressFamilies: fams,
}
res := &pb.ResolveReply{}
if err := internal.Call(ctx, "remote_socket", "Resolve", req, res); err != nil {
// XXX: need to map to pb.ResolveReply_ErrorCode?
return nil, false, err
}
return res.PackedAddress, true, nil
}
// withDeadline is like context.WithDeadline, except it ignores the zero deadline.
func withDeadline(parent context.Context, deadline time.Time) (context.Context, context.CancelFunc) {
if deadline.IsZero() {
return parent, func() {}
}
return context.WithDeadline(parent, deadline)
}
// Conn represents a socket connection.
// It implements net.Conn.
type Conn struct {
ctx context.Context
desc string
offset int64
prot pb.CreateSocketRequest_SocketProtocol
local, remote *pb.AddressPort
readDeadline, writeDeadline time.Time // optional
}
// SetContext sets the context that is used by this Conn.
// It is usually used only when using a Conn that was created in a different context,
// such as when a connection is created during a warmup request but used while
// servicing a user request.
func (cn *Conn) SetContext(ctx context.Context) {
cn.ctx = ctx
}
func (cn *Conn) Read(b []byte) (n int, err error) {
const maxRead = 1 << 20
if len(b) > maxRead {
b = b[:maxRead]
}
req := &pb.ReceiveRequest{
SocketDescriptor: &cn.desc,
DataSize: proto.Int32(int32(len(b))),
}
res := &pb.ReceiveReply{}
if !cn.readDeadline.IsZero() {
req.TimeoutSeconds = proto.Float64(cn.readDeadline.Sub(time.Now()).Seconds())
}
ctx, cancel := withDeadline(cn.ctx, cn.readDeadline)
defer cancel()
if err := internal.Call(ctx, "remote_socket", "Receive", req, res); err != nil {
return 0, err
}
if len(res.Data) == 0 {
return 0, io.EOF
}
if len(res.Data) > len(b) {
return 0, fmt.Errorf("socket: internal error: read too much data: %d > %d", len(res.Data), len(b))
}
return copy(b, res.Data), nil
}
func (cn *Conn) Write(b []byte) (n int, err error) {
const lim = 1 << 20 // max per chunk
for n < len(b) {
chunk := b[n:]
if len(chunk) > lim {
chunk = chunk[:lim]
}
req := &pb.SendRequest{
SocketDescriptor: &cn.desc,
Data: chunk,
StreamOffset: &cn.offset,
}
res := &pb.SendReply{}
if !cn.writeDeadline.IsZero() {
req.TimeoutSeconds = proto.Float64(cn.writeDeadline.Sub(time.Now()).Seconds())
}
ctx, cancel := withDeadline(cn.ctx, cn.writeDeadline)
defer cancel()
if err = internal.Call(ctx, "remote_socket", "Send", req, res); err != nil {
// assume zero bytes were sent in this RPC
break
}
n += int(res.GetDataSent())
cn.offset += int64(res.GetDataSent())
}
return
}
func (cn *Conn) Close() error {
req := &pb.CloseRequest{
SocketDescriptor: &cn.desc,
}
res := &pb.CloseReply{}
if err := internal.Call(cn.ctx, "remote_socket", "Close", req, res); err != nil {
return err
}
cn.desc = "CLOSED"
return nil
}
func addr(prot pb.CreateSocketRequest_SocketProtocol, ap *pb.AddressPort) net.Addr {
if ap == nil {
return nil
}
switch prot {
case pb.CreateSocketRequest_TCP:
return &net.TCPAddr{
IP: net.IP(ap.PackedAddress),
Port: int(*ap.Port),
}
case pb.CreateSocketRequest_UDP:
return &net.UDPAddr{
IP: net.IP(ap.PackedAddress),
Port: int(*ap.Port),
}
}
panic("unknown protocol " + prot.String())
}
func (cn *Conn) LocalAddr() net.Addr { return addr(cn.prot, cn.local) }
func (cn *Conn) RemoteAddr() net.Addr { return addr(cn.prot, cn.remote) }
func (cn *Conn) SetDeadline(t time.Time) error {
cn.readDeadline = t
cn.writeDeadline = t
return nil
}
func (cn *Conn) SetReadDeadline(t time.Time) error {
cn.readDeadline = t
return nil
}
func (cn *Conn) SetWriteDeadline(t time.Time) error {
cn.writeDeadline = t
return nil
}
// KeepAlive signals that the connection is still in use.
// It may be called to prevent the socket being closed due to inactivity.
func (cn *Conn) KeepAlive() error {
req := &pb.GetSocketNameRequest{
SocketDescriptor: &cn.desc,
}
res := &pb.GetSocketNameReply{}
return internal.Call(cn.ctx, "remote_socket", "GetSocketName", req, res)
}
func init() {
internal.RegisterErrorCodeMap("remote_socket", pb.RemoteSocketServiceError_ErrorCode_name)
}

View File

@ -1,64 +0,0 @@
// Copyright 2015 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// +build !appengine
package socket
import (
"net"
"time"
"golang.org/x/net/context"
)
// Dial connects to the address addr on the network protocol.
// The address format is host:port, where host may be a hostname or an IP address.
// Known protocols are "tcp" and "udp".
// The returned connection satisfies net.Conn, and is valid while ctx is valid;
// if the connection is to be used after ctx becomes invalid, invoke SetContext
// with the new context.
func Dial(ctx context.Context, protocol, addr string) (*Conn, error) {
conn, err := net.Dial(protocol, addr)
if err != nil {
return nil, err
}
return &Conn{conn}, nil
}
// DialTimeout is like Dial but takes a timeout.
// The timeout includes name resolution, if required.
func DialTimeout(ctx context.Context, protocol, addr string, timeout time.Duration) (*Conn, error) {
conn, err := net.DialTimeout(protocol, addr, timeout)
if err != nil {
return nil, err
}
return &Conn{conn}, nil
}
// LookupIP returns the given host's IP addresses.
func LookupIP(ctx context.Context, host string) (addrs []net.IP, err error) {
return net.LookupIP(host)
}
// Conn represents a socket connection.
// It implements net.Conn.
type Conn struct {
net.Conn
}
// SetContext sets the context that is used by this Conn.
// It is usually used only when using a Conn that was created in a different context,
// such as when a connection is created during a warmup request but used while
// servicing a user request.
func (cn *Conn) SetContext(ctx context.Context) {
// This function is not required in App Engine "flexible environment".
}
// KeepAlive signals that the connection is still in use.
// It may be called to prevent the socket being closed due to inactivity.
func (cn *Conn) KeepAlive() error {
// This function is not required in App Engine "flexible environment".
return nil
}

4
vendor/modules.txt vendored
View File

@ -952,7 +952,7 @@ golang.org/x/tools/internal/typesinternal
## explicit; go 1.17
golang.org/x/xerrors
golang.org/x/xerrors/internal
# google.golang.org/api v0.140.0
# google.golang.org/api v0.141.0
## explicit; go 1.19
google.golang.org/api/googleapi
google.golang.org/api/googleapi/transport
@ -980,9 +980,7 @@ google.golang.org/appengine/internal/datastore
google.golang.org/appengine/internal/log
google.golang.org/appengine/internal/modules
google.golang.org/appengine/internal/remote_api
google.golang.org/appengine/internal/socket
google.golang.org/appengine/internal/urlfetch
google.golang.org/appengine/socket
google.golang.org/appengine/urlfetch
# google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5
## explicit; go 1.19