Skip to content

Commit

Permalink
Add platform and python version to user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
epierce committed May 8, 2024
1 parent 8273a1e commit dad5004
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gimme_aws_creds/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import os
import re
import sys
import platform
import concurrent.futures

# extras
Expand Down Expand Up @@ -510,7 +511,7 @@ def okta_platform(self):
self.okta_org_url + '/.well-known/okta-organization',
headers={
'Accept': 'application/json',
'User-Agent': "gimme-aws-creds {}".format(version)
'User-Agent': "gimme-aws-creds {};{};{}".format(version, sys.platform, platform.python_version())
},
timeout=30
)
Expand Down
3 changes: 2 additions & 1 deletion gimme_aws_creds/okta_classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""
import base64
import sys
import platform
import copy
import re
import socket
Expand Down Expand Up @@ -292,7 +293,7 @@ def auth_oauth(self, client_id, **kwargs):
def _get_headers():
"""sets the default headers"""
headers = {
'User-Agent': "gimme-aws-creds {}".format(version),
'User-Agent': "gimme-aws-creds {};{};{}".format(version, sys.platform, platform.python_version()),
'Accept': 'application/json',
'Content-Type': 'application/json',
}
Expand Down
3 changes: 2 additions & 1 deletion gimme_aws_creds/okta_identity_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and* limitations under the License.*
"""
import platform
import time
import webbrowser
import jwt
Expand Down Expand Up @@ -200,7 +201,7 @@ def get_saml_response(self, url, auth_session):
def _get_headers():
"""sets the default headers"""
headers = {
'User-Agent': "gimme-aws-creds {}".format(version),
'User-Agent': "gimme-aws-creds {};{};{}".format(version, sys.platform, platform.python_version()),
'Accept': 'application/json'
}
return headers
Expand Down

0 comments on commit dad5004

Please sign in to comment.