Random id / secret creation and adding to Auth object Caution: Assumes auth.is_live is set Arguments Auth, Auth_api object Returns Auth, Auth_api object
(auth)
| 118 | |
| 119 | |
| 120 | def create_client_auth_pair(auth): |
| 121 | """ |
| 122 | Random id / secret creation and adding to Auth object |
| 123 | |
| 124 | Caution: |
| 125 | Assumes auth.is_live is set |
| 126 | |
| 127 | Arguments |
| 128 | Auth, Auth_api object |
| 129 | |
| 130 | Returns |
| 131 | Auth, Auth_api object |
| 132 | """ |
| 133 | |
| 134 | # For simplicity also include the string |
| 135 | # Right in name |
| 136 | |
| 137 | if auth.is_live == True: |
| 138 | auth.client_id = "LIVE__" |
| 139 | else: |
| 140 | auth.client_id = "TEST__" |
| 141 | |
| 142 | auth.client_id += create_random_string(length = 20) |
| 143 | auth.client_secret = create_random_string(length = 60) |
| 144 | |
| 145 | return auth |
| 146 | |
| 147 | |
| 148 | def create_random_string(length): |
no test coverage detected