Project

General

Profile

Actions

Bug #42794

open

mgr/dashboard: align front-end and back-end validation with core Ceph types

Added by Ernesto Puerta over 4 years ago. Updated about 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
General
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Currently we have validation in the front-end that it's stricter than core Ceph one.

As an example: for pool names we only allow [.A-Za-z0-9_/-] chars, that is, ASCII alphanum + some special chars (_/-). However, the type for Pool names in core Ceph is CephPoolname which turns out to be a Python str, essentially any utf-8 char:

$ ceph osd pool create 'hello world'
pool 'hello world' created

$ ceph osd pool create 'ñûôç'
pool 'ñûôç' created
That could happen also to other data types (RBD image names, snapshots, RGW users, etc.). In order to align this, there are different approaches available:
  • Manually creating Angular Custom Validators in the front-end aligned with the core Ceph types (src/pybind/ceph_argparse.py): CdValidators.cephPoolname.
  • Driving validation from the back-end. Being Python too, it might consume ceph_argparse.py types and automatically perform validation against actual core supported types. However, back-end driven validation (while necessary) results in a less responsive front-end behavior, even if that happens asynchronously in the background (data needs to go a round-trip).
  • The ultimate approach could be extract Ceph data types from ceph_argparse.py and use a cross-language data typing/model specification framework, like Json-schema. Json-schema validators are implemented for a lot of programmming languages (JS, Python, C++, Go...).
{
  "$id": "https://ceph.com/schemas/master/poolname.schema.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "CephPoolname",
  "type": "string",
  "pattern": "/...<whatever>.../" 
}
Actions #1

Updated by Lenz Grimmer over 4 years ago

  • Translation missing: en.field_tag_list set to refactoring
Actions #2

Updated by Ernesto Puerta about 3 years ago

  • Project changed from mgr to Dashboard
  • Category changed from 132 to General
Actions

Also available in: Atom PDF