Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cake-bot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
cake-bot
Commits
a2178a06
Commit
a2178a06
authored
Jan 26, 2023
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hack to debug the datetime comparison
parent
c8ed9694
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
azure_key_vault_client.py
utils/azure_key_vault_client.py
+9
-3
No files found.
utils/azure_key_vault_client.py
View file @
a2178a06
...
...
@@ -71,13 +71,19 @@ class AzureKeyVaultClient:
random_key
=
None
try
:
random_key
=
self
.
get_random_key_bl
()
if
datetime
.
now
()
>
random_key
.
properties
.
expires_on
:
now
=
datetime
.
utcnow
()
expires_on
=
random_key
.
properties
.
expires_on
print
(
f
"EXPIRES ON::NOW:{now}, EXPIRES_ON:{expires_on}"
)
try
:
if
now
>
expires_on
:
raise
IndexError
(
"Key's expired"
)
except
TypeError
:
raise
IndexError
(
"Key's expired"
)
except
IndexError
:
# create keys here
for
_
in
range
(
quantity
):
name
=
"
%
i"
%
(
datetime
.
now
()
.
timestamp
()
*
1000000
)
expires_on
=
datetime
.
now
()
+
timedelta
(
days
=
7
)
name
=
"
%
i"
%
(
datetime
.
utc
now
()
.
timestamp
()
*
1000000
)
expires_on
=
datetime
.
utc
now
()
+
timedelta
(
days
=
7
)
random_key
=
self
.
key_client
.
create_rsa_key
(
name
,
expires_on
=
expires_on
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment