Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: tokenserver/api/oauth_token_grant.pb.go

Issue 2785973002: token-server: Add protos for new API for generating service account tokens. (Closed)
Patch Set: more nits Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tokenserver/api/oauth_token_grant.pb.go
diff --git a/tokenserver/api/oauth_token_grant.pb.go b/tokenserver/api/oauth_token_grant.pb.go
new file mode 100644
index 0000000000000000000000000000000000000000..896067a94185a2545e7bc95bd823b08d205e5c3e
--- /dev/null
+++ b/tokenserver/api/oauth_token_grant.pb.go
@@ -0,0 +1,167 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: github.com/luci/luci-go/tokenserver/api/oauth_token_grant.proto
+
+package tokenserver
+
+import proto "github.com/golang/protobuf/proto"
+import fmt "fmt"
+import math "math"
+import google_protobuf "github.com/golang/protobuf/ptypes/timestamp"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// OAuthTokenGrantBody contains the internal guts of an oauth token grant.
+//
+// It gets serialized, signed and stuffed into OAuthTokenGrantEnvelope, which
+// then also gets serialized to get the final blob with the grant. This blob is
+// then base64-encoded and returned to the caller of MintOAuthTokenGrant.
+type OAuthTokenGrantBody struct {
+ // Identifier of this token as generated by the token server.
+ //
+ // Used for logging and tracking purposes.
+ //
+ // TODO(vadimsh): It may later be used for revocation purposes.
+ TokenId int64 `protobuf:"varint,1,opt,name=token_id,json=tokenId" json:"token_id,omitempty"`
+ // Service account identity the end user wants to act as.
+ //
+ // A string of the form "user:<email>".
+ ServiceAccount string `protobuf:"bytes,2,opt,name=service_account,json=serviceAccount" json:"service_account,omitempty"`
+ // Who requested this token and who can pass it to MintOAuthTokenViaGrant.
+ //
+ // A string of the form "user:<email>". On Swarming, this is Swarming's own
+ // service account name.
+ WielderIdentity string `protobuf:"bytes,3,opt,name=wielder_identity,json=wielderIdentity" json:"wielder_identity,omitempty"`
+ // An end user that wants to act as the service account (perhaps indirectly).
+ //
+ // A string of the form "user:<email>". On Swarming, this is an identity of
+ // a user that posted the task.
+ EndUserIdentity string `protobuf:"bytes,4,opt,name=end_user_identity,json=endUserIdentity" json:"end_user_identity,omitempty"`
+ // When the token was generated (and when it becomes valid).
+ IssuedAt *google_protobuf.Timestamp `protobuf:"bytes,5,opt,name=issued_at,json=issuedAt" json:"issued_at,omitempty"`
+ // How long the token is considered valid (in seconds).
+ //
+ // It may become invalid sooner if the token server policy changes and the
+ // new policy doesn't allow this token.
+ ValidityDuration int64 `protobuf:"varint,6,opt,name=validity_duration,json=validityDuration" json:"validity_duration,omitempty"`
+}
+
+func (m *OAuthTokenGrantBody) Reset() { *m = OAuthTokenGrantBody{} }
+func (m *OAuthTokenGrantBody) String() string { return proto.CompactTextString(m) }
+func (*OAuthTokenGrantBody) ProtoMessage() {}
+func (*OAuthTokenGrantBody) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
+
+func (m *OAuthTokenGrantBody) GetTokenId() int64 {
+ if m != nil {
+ return m.TokenId
+ }
+ return 0
+}
+
+func (m *OAuthTokenGrantBody) GetServiceAccount() string {
+ if m != nil {
+ return m.ServiceAccount
+ }
+ return ""
+}
+
+func (m *OAuthTokenGrantBody) GetWielderIdentity() string {
+ if m != nil {
+ return m.WielderIdentity
+ }
+ return ""
+}
+
+func (m *OAuthTokenGrantBody) GetEndUserIdentity() string {
+ if m != nil {
+ return m.EndUserIdentity
+ }
+ return ""
+}
+
+func (m *OAuthTokenGrantBody) GetIssuedAt() *google_protobuf.Timestamp {
+ if m != nil {
+ return m.IssuedAt
+ }
+ return nil
+}
+
+func (m *OAuthTokenGrantBody) GetValidityDuration() int64 {
+ if m != nil {
+ return m.ValidityDuration
+ }
+ return 0
+}
+
+// OAuthTokenGrantEnvelope is what is actually being serialized and send to
+// the callers of MintOAuthTokenGrant (after being encoded using base64 standard
+// raw encoding).
+type OAuthTokenGrantEnvelope struct {
+ TokenBody []byte `protobuf:"bytes,1,opt,name=token_body,json=tokenBody,proto3" json:"token_body,omitempty"`
+ KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId" json:"key_id,omitempty"`
+ Pkcs1Sha256Sig []byte `protobuf:"bytes,3,opt,name=pkcs1_sha256_sig,json=pkcs1Sha256Sig,proto3" json:"pkcs1_sha256_sig,omitempty"`
+}
+
+func (m *OAuthTokenGrantEnvelope) Reset() { *m = OAuthTokenGrantEnvelope{} }
+func (m *OAuthTokenGrantEnvelope) String() string { return proto.CompactTextString(m) }
+func (*OAuthTokenGrantEnvelope) ProtoMessage() {}
+func (*OAuthTokenGrantEnvelope) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
+
+func (m *OAuthTokenGrantEnvelope) GetTokenBody() []byte {
+ if m != nil {
+ return m.TokenBody
+ }
+ return nil
+}
+
+func (m *OAuthTokenGrantEnvelope) GetKeyId() string {
+ if m != nil {
+ return m.KeyId
+ }
+ return ""
+}
+
+func (m *OAuthTokenGrantEnvelope) GetPkcs1Sha256Sig() []byte {
+ if m != nil {
+ return m.Pkcs1Sha256Sig
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*OAuthTokenGrantBody)(nil), "tokenserver.OAuthTokenGrantBody")
+ proto.RegisterType((*OAuthTokenGrantEnvelope)(nil), "tokenserver.OAuthTokenGrantEnvelope")
+}
+
+func init() {
+ proto.RegisterFile("github.com/luci/luci-go/tokenserver/api/oauth_token_grant.proto", fileDescriptor1)
+}
+
+var fileDescriptor1 = []byte{
+ // 360 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x5d, 0x6b, 0xdb, 0x30,
+ 0x18, 0x85, 0x71, 0xb2, 0x64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