mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: update buildkit to v0.17.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
182
vendor/github.com/moby/buildkit/session/auth/auth.pb.go
generated
vendored
182
vendor/github.com/moby/buildkit/session/auth/auth.pb.go
generated
vendored
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc-gen-go v1.35.1
|
||||
// protoc v3.11.4
|
||||
// source: github.com/moby/buildkit/session/auth/auth.proto
|
||||
|
||||
@ -30,11 +30,9 @@ type CredentialsRequest struct {
|
||||
|
||||
func (x *CredentialsRequest) Reset() {
|
||||
*x = CredentialsRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CredentialsRequest) String() string {
|
||||
@ -45,7 +43,7 @@ func (*CredentialsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CredentialsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -78,11 +76,9 @@ type CredentialsResponse struct {
|
||||
|
||||
func (x *CredentialsResponse) Reset() {
|
||||
*x = CredentialsResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CredentialsResponse) String() string {
|
||||
@ -93,7 +89,7 @@ func (*CredentialsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CredentialsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -136,11 +132,9 @@ type FetchTokenRequest struct {
|
||||
|
||||
func (x *FetchTokenRequest) Reset() {
|
||||
*x = FetchTokenRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *FetchTokenRequest) String() string {
|
||||
@ -151,7 +145,7 @@ func (*FetchTokenRequest) ProtoMessage() {}
|
||||
|
||||
func (x *FetchTokenRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -213,11 +207,9 @@ type FetchTokenResponse struct {
|
||||
|
||||
func (x *FetchTokenResponse) Reset() {
|
||||
*x = FetchTokenResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *FetchTokenResponse) String() string {
|
||||
@ -228,7 +220,7 @@ func (*FetchTokenResponse) ProtoMessage() {}
|
||||
|
||||
func (x *FetchTokenResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -275,11 +267,9 @@ type GetTokenAuthorityRequest struct {
|
||||
|
||||
func (x *GetTokenAuthorityRequest) Reset() {
|
||||
*x = GetTokenAuthorityRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetTokenAuthorityRequest) String() string {
|
||||
@ -290,7 +280,7 @@ func (*GetTokenAuthorityRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetTokenAuthorityRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -329,11 +319,9 @@ type GetTokenAuthorityResponse struct {
|
||||
|
||||
func (x *GetTokenAuthorityResponse) Reset() {
|
||||
*x = GetTokenAuthorityResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetTokenAuthorityResponse) String() string {
|
||||
@ -344,7 +332,7 @@ func (*GetTokenAuthorityResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetTokenAuthorityResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -378,11 +366,9 @@ type VerifyTokenAuthorityRequest struct {
|
||||
|
||||
func (x *VerifyTokenAuthorityRequest) Reset() {
|
||||
*x = VerifyTokenAuthorityRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *VerifyTokenAuthorityRequest) String() string {
|
||||
@ -393,7 +379,7 @@ func (*VerifyTokenAuthorityRequest) ProtoMessage() {}
|
||||
|
||||
func (x *VerifyTokenAuthorityRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -439,11 +425,9 @@ type VerifyTokenAuthorityResponse struct {
|
||||
|
||||
func (x *VerifyTokenAuthorityResponse) Reset() {
|
||||
*x = VerifyTokenAuthorityResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *VerifyTokenAuthorityResponse) String() string {
|
||||
@ -454,7 +438,7 @@ func (*VerifyTokenAuthorityResponse) ProtoMessage() {}
|
||||
|
||||
func (x *VerifyTokenAuthorityResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[7]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -568,7 +552,7 @@ func file_github_com_moby_buildkit_session_auth_auth_proto_rawDescGZIP() []byte
|
||||
}
|
||||
|
||||
var file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_github_com_moby_buildkit_session_auth_auth_proto_goTypes = []interface{}{
|
||||
var file_github_com_moby_buildkit_session_auth_auth_proto_goTypes = []any{
|
||||
(*CredentialsRequest)(nil), // 0: moby.filesync.v1.CredentialsRequest
|
||||
(*CredentialsResponse)(nil), // 1: moby.filesync.v1.CredentialsResponse
|
||||
(*FetchTokenRequest)(nil), // 2: moby.filesync.v1.FetchTokenRequest
|
||||
@ -599,104 +583,6 @@ func file_github_com_moby_buildkit_session_auth_auth_proto_init() {
|
||||
if File_github_com_moby_buildkit_session_auth_auth_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CredentialsRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CredentialsResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FetchTokenRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FetchTokenResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetTokenAuthorityRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetTokenAuthorityResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VerifyTokenAuthorityRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VerifyTokenAuthorityResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
27
vendor/github.com/moby/buildkit/session/auth/authprovider/authprovider.go
generated
vendored
27
vendor/github.com/moby/buildkit/session/auth/authprovider/authprovider.go
generated
vendored
@ -24,6 +24,7 @@ import (
|
||||
"github.com/moby/buildkit/session"
|
||||
"github.com/moby/buildkit/session/auth"
|
||||
"github.com/moby/buildkit/util/progress/progresswriter"
|
||||
"github.com/moby/buildkit/util/tracing"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/crypto/nacl/sign"
|
||||
"google.golang.org/grpc"
|
||||
@ -73,7 +74,7 @@ func (ap *authProvider) Register(server *grpc.Server) {
|
||||
}
|
||||
|
||||
func (ap *authProvider) FetchToken(ctx context.Context, req *auth.FetchTokenRequest) (rr *auth.FetchTokenResponse, err error) {
|
||||
ac, err := ap.getAuthConfig(req.Host)
|
||||
ac, err := ap.getAuthConfig(ctx, req.Host)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -83,7 +84,7 @@ func (ap *authProvider) FetchToken(ctx context.Context, req *auth.FetchTokenRequ
|
||||
return toTokenResponse(ac.RegistryToken, time.Time{}, 0), nil
|
||||
}
|
||||
|
||||
creds, err := ap.credentials(req.Host)
|
||||
creds, err := ap.credentials(ctx, req.Host)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -96,11 +97,11 @@ func (ap *authProvider) FetchToken(ctx context.Context, req *auth.FetchTokenRequ
|
||||
Secret: creds.Secret,
|
||||
}
|
||||
|
||||
httpClient := http.DefaultClient()
|
||||
httpClient := tracing.DefaultClient
|
||||
if tc, err := ap.tlsConfig(req.Host); err == nil && tc != nil {
|
||||
transport := http.DefaultTransport()
|
||||
transport.TLSClientConfig = tc
|
||||
httpClient.Transport = transport
|
||||
httpClient.Transport = tracing.NewTransport(transport)
|
||||
}
|
||||
|
||||
if creds.Secret != "" {
|
||||
@ -186,8 +187,8 @@ func (ap *authProvider) tlsConfig(host string) (*tls.Config, error) {
|
||||
return tc, nil
|
||||
}
|
||||
|
||||
func (ap *authProvider) credentials(host string) (*auth.CredentialsResponse, error) {
|
||||
ac, err := ap.getAuthConfig(host)
|
||||
func (ap *authProvider) credentials(ctx context.Context, host string) (*auth.CredentialsResponse, error) {
|
||||
ac, err := ap.getAuthConfig(ctx, host)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -202,7 +203,7 @@ func (ap *authProvider) credentials(host string) (*auth.CredentialsResponse, err
|
||||
}
|
||||
|
||||
func (ap *authProvider) Credentials(ctx context.Context, req *auth.CredentialsRequest) (*auth.CredentialsResponse, error) {
|
||||
resp, err := ap.credentials(req.Host)
|
||||
resp, err := ap.credentials(ctx, req.Host)
|
||||
if err != nil || resp.Secret != "" {
|
||||
ap.mu.Lock()
|
||||
defer ap.mu.Unlock()
|
||||
@ -218,7 +219,7 @@ func (ap *authProvider) Credentials(ctx context.Context, req *auth.CredentialsRe
|
||||
}
|
||||
|
||||
func (ap *authProvider) GetTokenAuthority(ctx context.Context, req *auth.GetTokenAuthorityRequest) (*auth.GetTokenAuthorityResponse, error) {
|
||||
key, err := ap.getAuthorityKey(req.Host, req.Salt)
|
||||
key, err := ap.getAuthorityKey(ctx, req.Host, req.Salt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -227,7 +228,7 @@ func (ap *authProvider) GetTokenAuthority(ctx context.Context, req *auth.GetToke
|
||||
}
|
||||
|
||||
func (ap *authProvider) VerifyTokenAuthority(ctx context.Context, req *auth.VerifyTokenAuthorityRequest) (*auth.VerifyTokenAuthorityResponse, error) {
|
||||
key, err := ap.getAuthorityKey(req.Host, req.Salt)
|
||||
key, err := ap.getAuthorityKey(ctx, req.Host, req.Salt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -238,7 +239,7 @@ func (ap *authProvider) VerifyTokenAuthority(ctx context.Context, req *auth.Veri
|
||||
return &auth.VerifyTokenAuthorityResponse{Signed: sign.Sign(nil, req.Payload, priv)}, nil
|
||||
}
|
||||
|
||||
func (ap *authProvider) getAuthConfig(host string) (*types.AuthConfig, error) {
|
||||
func (ap *authProvider) getAuthConfig(ctx context.Context, host string) (*types.AuthConfig, error) {
|
||||
ap.mu.Lock()
|
||||
defer ap.mu.Unlock()
|
||||
|
||||
@ -247,7 +248,9 @@ func (ap *authProvider) getAuthConfig(host string) (*types.AuthConfig, error) {
|
||||
}
|
||||
|
||||
if _, exists := ap.authConfigCache[host]; !exists {
|
||||
span, _ := tracing.StartSpan(ctx, fmt.Sprintf("load credentials for %s", host))
|
||||
ac, err := ap.config.GetAuthConfig(host)
|
||||
tracing.FinishWithError(span, err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -257,12 +260,12 @@ func (ap *authProvider) getAuthConfig(host string) (*types.AuthConfig, error) {
|
||||
return ap.authConfigCache[host], nil
|
||||
}
|
||||
|
||||
func (ap *authProvider) getAuthorityKey(host string, salt []byte) (ed25519.PrivateKey, error) {
|
||||
func (ap *authProvider) getAuthorityKey(ctx context.Context, host string, salt []byte) (ed25519.PrivateKey, error) {
|
||||
if v, err := strconv.ParseBool(os.Getenv("BUILDKIT_NO_CLIENT_TOKEN")); err == nil && v {
|
||||
return nil, status.Errorf(codes.Unavailable, "client side tokens disabled")
|
||||
}
|
||||
|
||||
creds, err := ap.credentials(host)
|
||||
creds, err := ap.credentials(ctx, host)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user