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

Side by Side Diff: tools/origin_trials/generate_token.py

Issue 2733023002: [Origin Trials] Support updates of disabled token list (Closed)
Patch Set: Address comments Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/test/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Utility for generating experimental API tokens 6 """Utility for generating experimental API tokens
7 7
8 usage: generate_token.py [-h] [--key-file KEY_FILE] 8 usage: generate_token.py [-h] [--key-file KEY_FILE]
9 [--expire-days EXPIRE_DAYS | 9 [--expire-days EXPIRE_DAYS |
10 --expire-timestamp EXPIRE_TIMESTAMP] 10 --expire-timestamp EXPIRE_TIMESTAMP]
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 sys.exit(1) 173 sys.exit(1)
174 174
175 175
176 # Output the token details 176 # Output the token details
177 print "Token details:" 177 print "Token details:"
178 print " Origin: %s" % args.origin 178 print " Origin: %s" % args.origin
179 print " Is Subdomain: %s" % args.is_subdomain 179 print " Is Subdomain: %s" % args.is_subdomain
180 print " Feature: %s" % args.trial_name 180 print " Feature: %s" % args.trial_name
181 print " Expiry: %d (%s UTC)" % (expiry, datetime.utcfromtimestamp(expiry)) 181 print " Expiry: %d (%s UTC)" % (expiry, datetime.utcfromtimestamp(expiry))
182 print " Signature: %s" % ", ".join('0x%02x' % ord(x) for x in signature) 182 print " Signature: %s" % ", ".join('0x%02x' % ord(x) for x in signature)
183 print " Signature (Base64): %s" % base64.b64encode(signature)
183 print 184 print
184 185
185 # Output the properly-formatted token. 186 # Output the properly-formatted token.
186 print FormatToken(VERSION, signature, token_data) 187 print FormatToken(VERSION, signature, token_data)
187 188
188 if __name__ == "__main__": 189 if __name__ == "__main__":
189 main() 190 main()
OLDNEW
« no previous file with comments | « chrome/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698