mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 03:11:55 +02:00
Impelment account deactivation [revision requested] (#3571)
Impelment account deactivation
This commit is contained in:
committed by
Brad Warren
parent
0fa307806e
commit
49d46ef99a
@@ -3,6 +3,7 @@ import datetime
|
||||
import hashlib
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import socket
|
||||
|
||||
from cryptography.hazmat.primitives import serialization
|
||||
@@ -197,6 +198,18 @@ class AccountFileStorage(interfaces.AccountStorage):
|
||||
"""
|
||||
self._save(account, regr_only=True)
|
||||
|
||||
def delete(self, account_id):
|
||||
"""Delete registration info from disk
|
||||
|
||||
:param account_id: id of account which should be deleted
|
||||
|
||||
"""
|
||||
account_dir_path = self._account_dir_path(account_id)
|
||||
if not os.path.isdir(account_dir_path):
|
||||
raise errors.AccountNotFound(
|
||||
"Account at %s does not exist" % account_dir_path)
|
||||
shutil.rmtree(account_dir_path)
|
||||
|
||||
def _save(self, account, regr_only):
|
||||
account_dir_path = self._account_dir_path(account.id)
|
||||
util.make_or_verify_dir(account_dir_path, 0o700, os.geteuid(),
|
||||
|
||||
Reference in New Issue
Block a user