Skip to content

Changes

Started 2 hr 31 min ago
Queued 7.5 sec
Took 13 min on built-in

Summary

  1. personalization: refactor ConfigurableParameter, Iccid, Imsi (details)
  2. personalization: refactor Puk (details)
  3. personalization: refactor Pin, Adm (details)
  4. personalization: refactor AlgorithmID, K, Opc (details)
  5. personalization: refactor SdKey (details)
  6. personalization: refactor SmspTpScAddr (details)
  7. personalization: set some typical parameter names (details)
  8. personalization: set example input values (details)
Commit 742baeab56b6a5f9d6a15daf20ebdd06a9b2c985 by laforge
personalization: refactor ConfigurableParameter, Iccid, Imsi

Main points/rationales of the refactoring, details below:
1) common validation implementation
2) offer classmethods

The new features are optional, and will be heavily used by batch
personalization patches coming soon.

Implement Iccid and Imsi to use the new way, with a common abstract
DecimalParam implementation.

So far leave the other parameter classes working as they always did, to
follow suit in subsequent commits.

Details:

1) common validation implementation:
There are very common validation steps in the various parameter
implementations. It is more convenient and much more readable to
implement those once and set simple validation parameters per subclass.
So there now is a validate_val() classmethod, which subclasses can use
as-is to apply the validation parameters -- or subclasses can override
their cls.validate_val() for specialized validation.
(Those subclasses that this patch doesn't touch still override the
self.validate() instance method. Hence they still work as before this
patch, but don't use the new common features yet.)

2) offer stateless classmethods:
It is useful for...
- batch processing of multiple profiles (in upcoming patches) and
- user input validation
to be able to have classmethods that do what self.validate() and
self.apply() do, but do not modify any self.* members.
So far the paradigm was to create a class instance to keep state about
the value. This remains available, but in addition we make available the
paradigm of a singleton that is stateless (the classmethods).
Using self.validate() and self.apply() still work the same as before
this patch, i.e. via self.input_value and self.value -- but in addition,
there are now classmethods that don't touch self.* members.

Related: SYS#6768
Change-Id: I6522be4c463e34897ca9bff2309b3706a88b3ce8
The file was modifiedpySim/esim/saip/personalization.py
Commit 21641816ea7132c1ad14227f15eac3678d0cec86 by laforge
personalization: refactor Puk

Implement abstract DecimalHexParam, and use it to refactor Puk1 and Puk2
to the new ConfigurableParameter implementation style.

DecimalHexParam will also be used for Pin and Adm soon.

Change-Id: I271e6c030c890778ab7af9ab3bc7997e22018f6a
The file was modifiedpySim/esim/saip/personalization.py
Commit d5b570b01d806571ff705ccca12c35c16071c17a by laforge
personalization: refactor Pin, Adm

Refactor Pin1, Pin2, Adm1 and Adm2 to the new ConfigurableParameter
implementation style.

Change-Id: I54aef10b6d4309398d4b779a3740a7d706d68603
The file was modifiedpySim/esim/saip/personalization.py
Commit ae656c66a3b3a382644ca895d808bca0dad9f2b2 by laforge
personalization: refactor AlgorithmID, K, Opc

Refactor AlgorithmID, K, Opc to the new ConfigurableParameter
implementation style.

K and Opc use a common abstract BinaryParam.

Note from the future: AlgorithmID so far takes "raw" int values, but
will turn to be an "enum" parameter with predefined meaningful strings
in I71c2ec1b753c66cb577436944634f32792353240

Change-Id: I6296fdcfd5d2ed313c4aade57ff43cc362375848
The file was modifiedpySim/esim/saip/personalization.py
Commit 1e9885610585a6b1b22c969b45aaf736fcba4d55 by laforge
personalization: refactor SdKey

Refactor SdKey (and subclasses) to the new ConfigurableParameter
implementation style, keeping the same implementation.

But duly note that this implementation does not work!
It correctly patches pe.decoded[], but that gets overridden by
ProfileElementSD._pre_encode().

For a fix, see I07dfc378705eba1318e9e8652796cbde106c6a52.

Change-Id: I427ea851bfa28b2b045e70a19a9e35d361f0d393
The file was modifiedpySim/esim/saip/personalization.py
Commit 1c082da0ee6cbdcfd08c053f4a2577043f831b9c by laforge
personalization: refactor SmspTpScAddr

Refactor SmspTpScAddr to the new ConfigurableParameter implementation
style.

Change-Id: I2600369e195e9f5aed7f4e6ff99ae273ed3ab3bf
The file was modifiedpySim/esim/saip/personalization.py
Commit db17529136e480563bb4bc86d799511672b60d4a by laforge
personalization: set some typical parameter names

These names better match what humans expect to read, for example "PIN1"
instead of "Pin1".

(We still fall back to the __class__.__name__ if a subclass omits a
specific name, see the ConfigurableParameter init.)

Change-Id: I31f390d634e58c384589c50a33ca45d6f86d4e10
The file was modifiedpySim/esim/saip/personalization.py
Commit ccc1a047abfd367c2a906cee1733b998b115d6a3 by laforge
personalization: set example input values

For all ConfigurableParameter subclasses, provide an example_input.

This may be useful for downstream projects' user interaction, to suggest
a value or prefill an input field, as appropriate.

Related: SYS#6768
Change-Id: I2672fedcbc32cb7a6cb0c233a4a22112bd9aae03
The file was modifiedpySim/esim/saip/personalization.py