-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(pubsub): support payload wrapping for push subs #8292
Conversation
@@ -498,6 +498,11 @@ func (s *GServer) CreateSubscription(_ context.Context, ps *pb.Subscription) (*p | |||
} | |||
if ps.PushConfig == nil { | |||
ps.PushConfig = &pb.PushConfig{} | |||
} else if ps.PushConfig.Wrapper == nil { | |||
// Wrapper should default to PubsubWrapper. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defaulting to nil is also acceptable and is treated as PubsubWrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just implementing that behavior in the fake server we provide. The client doesn't know about the default and should default to nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's times like this I wish oneof yielded a proto type we could embed, but the isWrapper() interface seems sufficient here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stamp for vet.sh
change.
This PR introduces the new payload unwrapping feature to the handwritten admin client.
Docs here: https://cloud.google.com/pubsub/docs/payload-unwrapping
Changes to
vet.sh
are because includingpubsub.PubsubWrapper
is intentional. PubsubWrapper is the name included in the proto. The alternative would be defining it aspubsub.PushConfigPubsubWrapper
which seems perhaps more verbose and inconsistent with what we've already been doing (like with pubsub.OIDCToken)[https://pkg.go.dev/cloud.google.com/go/pubsub#OIDCToken]