MCPcopy Index your code
hub / github.com/diffgram/diffgram / create_client_auth_pair

Function create_client_auth_pair

default/methods/auth/api/auth_api_new.py:120–145  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

118
119
120def 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
148def create_random_string(length):

Callers 1

createFunction · 0.85

Calls 1

create_random_stringFunction · 0.70

Tested by

no test coverage detected