| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 syntax = "proto3"; | 5 syntax = "proto3"; |
| 6 | 6 |
| 7 package tokenserver.minter; | 7 package tokenserver.minter; |
| 8 | 8 |
| 9 import "google/protobuf/timestamp.proto"; | 9 import "google/protobuf/timestamp.proto"; |
| 10 | 10 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // An end user that wants to act as the service account (perhaps indirectly). | 333 // An end user that wants to act as the service account (perhaps indirectly). |
| 334 // | 334 // |
| 335 // A string of the form "user:<email>". On Swarming, this is an identity of | 335 // A string of the form "user:<email>". On Swarming, this is an identity of |
| 336 // a user that posted the task. | 336 // a user that posted the task. |
| 337 // | 337 // |
| 338 // TODO(vadimsh): Verify that this user is present during MintOAuthTokenGrant | 338 // TODO(vadimsh): Verify that this user is present during MintOAuthTokenGrant |
| 339 // RPC by requiring the end user's credentials, e.g make Swarming forward | 339 // RPC by requiring the end user's credentials, e.g make Swarming forward |
| 340 // user's OAuth token to the token server, where it can be validated. | 340 // user's OAuth token to the token server, where it can be validated. |
| 341 // | 341 // |
| 342 // Required. | 342 // Required. |
| 343 string end_user_identity = 3; | 343 string end_user = 3; |
| 344 | 344 |
| 345 // Optional reason why the grant is created. | 345 // Optional reason why the grant is created. |
| 346 // | 346 // |
| 347 // Used only for logging and auditing purposes. Doesn't become part of the | 347 // Used only for logging and auditing purposes. Doesn't become part of the |
| 348 // grant. | 348 // grant. |
| 349 string intent = 4; | 349 string intent = 4; |
| 350 } | 350 } |
| 351 | 351 |
| 352 | 352 |
| 353 // MintOAuthTokenGrantResponse is returned by MintOAuthTokenGrant. | 353 // MintOAuthTokenGrantResponse is returned by MintOAuthTokenGrant. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 367 // | 367 // |
| 368 // Additional implicit field is the identity of whoever makes this call. It is | 368 // Additional implicit field is the identity of whoever makes this call. It is |
| 369 // compared against 'wielder_identity' inside the token. | 369 // compared against 'wielder_identity' inside the token. |
| 370 message MintOAuthTokenViaGrantRequest { | 370 message MintOAuthTokenViaGrantRequest { |
| 371 // A previously generated grant, as returned by MintOAuthTokenGrant. | 371 // A previously generated grant, as returned by MintOAuthTokenGrant. |
| 372 string grant_token = 1; | 372 string grant_token = 1; |
| 373 | 373 |
| 374 // The list of OAuth scopes the access token should have. | 374 // The list of OAuth scopes the access token should have. |
| 375 // | 375 // |
| 376 // The server may reject the request if some scopes are not allowed. | 376 // The server may reject the request if some scopes are not allowed. |
| 377 repeated string oauth_scopes = 2; | 377 repeated string oauth_scope = 2; |
| 378 | 378 |
| 379 // Minimally accepted validity duration of the returned OAuth token (seconds). | 379 // Minimally accepted validity duration of the returned OAuth token (seconds). |
| 380 // | 380 // |
| 381 // The server may return a token that lives longer than this. The maximum is | 381 // The server may return a token that lives longer than this. The maximum is |
| 382 // 1h. An attempt to get a token that lives longer than 1h will result in | 382 // 1h. An attempt to get a token that lives longer than 1h will result in |
| 383 // an error. | 383 // an error. |
| 384 // | 384 // |
| 385 // The returned token validity duration doesn't depend on the lifetime of | 385 // The returned token validity duration doesn't depend on the lifetime of |
| 386 // the grant: it's possible to use a grant that expires in 1 sec to get an | 386 // the grant: it's possible to use a grant that expires in 1 sec to get an |
| 387 // access token that lives for 1h. | 387 // access token that lives for 1h. |
| 388 // | 388 // |
| 389 // Default is 300 sec. | 389 // Default is 300 sec. |
| 390 int64 min_validity_duration = 3; | 390 int64 min_validity_duration = 3; |
| 391 } | 391 } |
| 392 | 392 |
| 393 | 393 |
| 394 // MintOAuthTokenViaGrantResponse is returned by MintOAuthTokenViaGrant. | 394 // MintOAuthTokenViaGrantResponse is returned by MintOAuthTokenViaGrant. |
| 395 message MintOAuthTokenViaGrantResponse { | 395 message MintOAuthTokenViaGrantResponse { |
| 396 string access_token = 1; // service account OAuth2 access token | 396 string access_token = 1; // service account OAuth2 access token |
| 397 google.protobuf.Timestamp expiry = 2; // when this token expires | 397 google.protobuf.Timestamp expiry = 2; // when this token expires |
| 398 | 398 |
| 399 // Identifier of the service and its version that produced the token. | 399 // Identifier of the service and its version that produced the token. |
| 400 // | 400 // |
| 401 // Has the form "<app-id>/<module-version>". Used only for logging and | 401 // Has the form "<app-id>/<module-version>". Used only for logging and |
| 402 // monitoring. | 402 // monitoring. |
| 403 string service_version = 3; | 403 string service_version = 3; |
| 404 } | 404 } |
| OLD | NEW |