Skip to content

Commit

Permalink
codeclimiate
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirupma-Verma committed Aug 7, 2023
1 parent c1fed09 commit ba9b96c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions conjur_api/models/general/credentials_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from datetime import datetime
EXPIRATION_FORMAT = "%Y-%m-%d %H:%M:%S"


class OidcCodeDetail:
"""
Used for setting user input data to login to Conjur using OIDC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
def create_credentials(machine: str = "machine", username: str = "some_username", password: str = "some_password", api_key: str = "some_api_key") -> CredentialsData:
return CredentialsData(machine, username, password, api_key)

def oidc_v2_credential(machine: str = "machine", code = "code", code_verifier = "coded_verifier", nonce="nonce") -> CredentialsData:

def oidc_v2_credential(machine: str="machine", code="code", code_verifier="coded_verifier", nonce="nonce") -> CredentialsData:
oidc_detail = OidcCodeDetail(code, code_verifier, nonce)
return CredentialsData(machine, oidc_detail)

Expand Down Expand Up @@ -83,11 +84,11 @@ def test_get_store_location(self):
self.assertEqual("SimpleCredentialsProvider",provider.get_store_location())

def test_oidc_v2_credentials_are_exist(self):
provider = SimpleCredentialsProvider()
oidc_provider = SimpleCredentialsProvider()
credentials_data = oidc_v2_credential()
provider.save(credentials_data)
self.assertTrue(provider.is_exists(credentials_data.machine))
self.assertFalse(provider.is_exists("not_exists_machine"))
oidc_provider.save(credentials_data)
self.assertTrue(oidc_provider.is_exists(credentials_data.machine))
self.assertFalse(oidc_provider.is_exists("not_exists_machine"))

def test_cleanup_oidc_v2_credentials_if_exist(self):
provider = SimpleCredentialsProvider()
Expand Down

0 comments on commit ba9b96c

Please sign in to comment.