<commit_before>#!/usr/bin/env python

"""
Sign a user's SSH public key.
"""
from __future__ import print_function
from argparse import ArgumentParser
from datetime import datetime, timedelta
from json import dumps
from os import remove, stat
from random import choice
from re import compile as re_compile
from shutil import move
from string import ascii_lowercase
from tempfile import NamedTemporaryFile
from time import time
from urllib import unquote_plus

# Third party library imports
from configparser import ConfigParser, NoOptionError
from ldap import open as ldap_open, SCOPE_SUBTREE
from psycopg2 import connect, OperationalError, ProgrammingError
from requests import Session
from requests.exceptions import ConnectionError
from web import application, config, ctx, data, httpserver
from web.wsgiserver import CherryPyWSGIServer

# Own library
from ssh_utils import Authority, get_fingerprint

# DEBUG
# from pdb import set_trace as st

STATES = {
    0: 'ACTIVE',
    1: 'REVOKED',
    2: 'PENDING',
}

URLS = (
    '/admin/([a-z]+)', 'Admin',
    '/ca', 'Ca',
    '/client', 'Client',
    '/client/status', 'ClientStatus',
    '/cluster/updatekrl', 'ClusterUpdateKRL',
    '/cluster/status', 'ClusterStatus',
    '/health', 'Health',
    '/krl', 'Krl',
    '/ping', 'Ping',
    '/test_auth', 'TestAuth',
)

VERSION = '1.6.2'

REQ_HEADERS = {
    'User-Agent': 'CASSH-SERVER v%s' % VERSION,
    'SERVER_VERSION': VERSION,
}
REQ_TIMEOUT = 2

PARSER = ArgumentParser()
PARSER.add_argument('-c', '--config', action='store', help='Configuration file')
PARSER.add_argument('-v', '--verbose', action='store_true', default=False, help='Add verbosity')
ARGS = PARSER.parse_args()

if not ARGS.config:
    PARSER.error('--config argument is required !')

CONFIG = ConfigParser()
CONFIG.read(ARGS.config)<commit_msg>[CASSH Server] Increment version number<commit_after>#!/usr/bin/env python

"""
Sign a user's SSH public key.
"""
from __future__ import print_function
from argparse import ArgumentParser
from datetime import datetime, timedelta
from json import dumps
from os import remove, stat
from random import choice
from re import compile as re_compile
from shutil import move
from string import ascii_lowercase
from tempfile import NamedTemporaryFile
from time import time
from urllib import unquote_plus

# Third party library imports
from configparser import ConfigParser, NoOptionError
from ldap import open as ldap_open, SCOPE_SUBTREE
from psycopg2 import connect, OperationalError, ProgrammingError
from requests import Session
from requests.exceptions import ConnectionError
from web import application, config, ctx, data, httpserver
from web.wsgiserver import CherryPyWSGIServer

# Own library
from ssh_utils import Authority, get_fingerprint

# DEBUG
# from pdb import set_trace as st

STATES = {
    0: 'ACTIVE',
    1: 'REVOKED',
    2: 'PENDING',
}

URLS = (
    '/admin/([a-z]+)', 'Admin',
    '/ca', 'Ca',
    '/client', 'Client',
    '/client/status', 'ClientStatus',
    '/cluster/updatekrl', 'ClusterUpdateKRL',
    '/cluster/status', 'ClusterStatus',
    '/health', 'Health',
    '/krl', 'Krl',
    '/ping', 'Ping',
    '/test_auth', 'TestAuth',
)

VERSION = '1.7.0'

REQ_HEADERS = {
    'User-Agent': 'CASSH-SERVER v%s' % VERSION,
    'SERVER_VERSION': VERSION,
}
REQ_TIMEOUT = 2

PARSER = ArgumentParser()
PARSER.add_argument('-c', '--config', action='store', help='Configuration file')
PARSER.add_argument('-v', '--verbose', action='store_true', default=False, help='Add verbosity')
ARGS = PARSER.parse_args()

if not ARGS.config:
    PARSER.error('--config argument is required !')

CONFIG = ConfigParser()
CONFIG.read(ARGS.config)
{'fraction_non_alphanumeric': 0.11967213114754098, 'fraction_numerical': 0.004371584699453552, 'mean_word_length': 4.747252747252747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4513372', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1150, 'n_words': 363}