@@ -84,8 +84,7 @@ def __kwargs_updater(self, method, **kwargs):
84
84
protected ['kid' ] = kid
85
85
protected .pop ("jwk" )
86
86
data = kwargs .get ("data" )
87
- if data :
88
- kwargs ['data' ] = sign_request_v2 (key , protected , data )
87
+ kwargs ['data' ] = sign_request_v2 (key , protected , data )
89
88
if self .peasant .verify :
90
89
kwargs ['verify' ] = self .peasant .verify
91
90
return kwargs
@@ -130,9 +129,8 @@ def get_registration(self, account: Account):
130
129
Get available account information from the server.
131
130
"""
132
131
headers = {'Content-Type' : "application/jose+json" }
133
- response = self .post_as_get (account .uri , headers = headers ,
134
- kid = self .account .uri ,
135
- key = account .key , uri = account .uri )
132
+ response = self .post (account .uri , headers = headers , kid = account .uri ,
133
+ key = account .key , uri = account .uri )
136
134
if str (response .status_code ).startswith ("2" ):
137
135
return _json (response )
138
136
raise AcmeError (response )
@@ -154,8 +152,8 @@ def new_account(self, account: Account, contacts: list,
154
152
}
155
153
headers = {'Content-Type' : "application/jose+json" }
156
154
path = self .peasant .directory ()['newAccount' ]
157
- response = self .post_as_get (path , data = payload , headers = headers ,
158
- key = account .key , uri = path )
155
+ response = self .post (path , data = payload , headers = headers ,
156
+ key = account .key , uri = path )
159
157
160
158
uri = response .headers .get ("Location" )
161
159
@@ -172,11 +170,11 @@ def new_account(self, account: Account, contacts: list,
172
170
raise AcmeError (response )
173
171
174
172
def terms_from_directory (self ):
175
- response = self . get_directory ()
176
- if response . status_code == 200 :
177
- if "meta" in response . json () :
178
- if "termsOfService" in response . json () ['meta' ]:
179
- return response . json () ['meta' ]['termsOfService' ]
173
+ # TODO: Check how to trigger an error here
174
+ directory = self . peasant . directory ()
175
+ if "meta" in directory :
176
+ if "termsOfService" in directory ['meta' ]:
177
+ return directory ['meta' ]['termsOfService' ]
180
178
return None
181
179
182
180
0 commit comments