Project

General

Profile

Bug #31384

valider l'URL lors de création de service

Added by Christophe Siraut 8 months ago. Updated 7 months ago.

Status:
Solution déployée
Priority:
Normal
Category:
-
Target version:
-
Start date:
13 Mar 2019
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

Quand je tente de créer un service via hobo (par exemple welco ou fargo) en omettant le préfixe https:// dans l'URL du service, une déploiement est lancé, mais les fichiers se retrouvent créés dans /var/lib/$app/ au lieu de /var/lib/$app/$tenant.

Associated revisions

Revision e2ffab60 (diff)
Added by Christophe Siraut 7 months ago

ServiceBase: validate base_url (#31384)

History

#3 Updated by Christophe Siraut 7 months ago

  • Assignee set to Christophe Siraut

#4 Updated by Christophe Siraut 7 months ago

  • Status changed from Nouveau to Solution proposée

#5 Updated by Christophe Siraut 7 months ago

  • Subject changed from valider/compléter l'URL lors de création de service to valider l'URL lors de création de service

#6 Updated by Nicolas Roche 7 months ago

  • Status changed from Solution proposée to Solution validée

Peut-être réitérer plusieurs fois le même test (par exemple tester l’omission de 'http://' qui est l'objet du ticket)

 def test_invalid_url():
    kwargs = {'title': 'Combo test',
              'last_operational_success_timestamp': timezone.now(),
              'last_operational_check_timestamp': timezone.now(),
              'secret_key': '1nesüper5Cr!eteKAaY~'}
    cpt = 0; # slugs must be unique

    # accept well formated url
    for url in ('https://example.com', 'http://example.com'):
        cpt += 1
        slug = 'wesh' + str(cpt)
        combo = Combo(base_url=url, slug=slug ,**kwargs)
        combo.full_clean()
        combo.save()
        assert True  # no exception raised

    # reject baddly formated url
    for url in ('example.com', 'http:/example.com', 'file:///home/me'):
        cpt += 1
        slug = 'wesh' + str(cpt)
        with pytest.raises(ValidationError):
            combo = Combo(base_url=url, slug='wesh_'+str(cpt), **kwargs)
            combo.full_clean()
            combo.save()

A part ça, pour moi c'est bon.

#7 Updated by Christophe Siraut 7 months ago

  • Status changed from Solution validée to Résolu (à déployer)
commit 9f715b356a1fc54f373adf732e9ba1d48eacf1b9 (HEAD -> master, origin/master, origin/HEAD, wip/31384-valider-completer-l-URL-lors-de-creation-de-service)
Author: Christophe Siraut <csiraut@entrouvert.com>
Date:   Fri Apr 12 14:46:50 2019 +0200

    cook : perform clean_fields() validations

commit e2ffab609d5d618b37c7114397ade48c3b24ad34
Author: Christophe Siraut <csiraut@entrouvert.com>
Date:   Fri Apr 12 14:20:32 2019 +0200

    ServiceBase: validate base_url (#31384)

#8 Updated by Frédéric Péters 7 months ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF