Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 493022a0

Přidáno uživatelem Jan Pašek před asi 4 roky(ů)

Re #8475 - Connection to the RestAPI

Zobrazit rozdíly:

src/constants.py
2 2

  
3 3
DATABASE_FILE = "db/database_sqlite.db"
4 4
DATABASE_FILE_LOCATION = FileAnchor("aswi2021jmsd", DATABASE_FILE)
5
DATETIME_FORMAT = "%m.%d.%Y %H:%M:%S"
5
DATETIME_FORMAT = "%d.%m.%Y %H:%M:%S"
6 6

  
7 7
# Types of certificates
8 8
ROOT_CA_ID = 1
src/controllers/certificates_controller.py
102 102

  
103 103
            key = KEY_SERVICE.create_new_key()                                      # TODO pass key
104 104

  
105
            if CA not in body:                                                      # if issuer omitted (legal)
105
            if CA not in body or body[CA] is None:                                  # if issuer omitted (legal) or none
106 106
                cert = CERTIFICATE_SERVICE.create_root_ca(                          # create a root CA
107 107
                    key,
108 108
                    subject,
static/js/constants.js
1 1
// API base url - in production it shall be only '/api/'
2
const API_URL = "https://virtserver.swaggerhub.com/janpasek97/X509_management/1.0.0/api/";
2
const API_URL = "/api/";
static/js/create_certificate.js
54 54
                        alert("CN field must be filled in!"); // TODO highlight the field
55 55
                        return;
56 56
                    }
57
                    // send the request and handle response
57
                    this.certificateData.validityDays = parseInt(this.certificateData.validityDays);
58 58
                    axios.post(API_URL + "certificates", this.certificateData)
59 59
                        .then(function (response) {
60 60
                            // on success return to index page

Také k dispozici: Unified diff