Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

esim_activation (1) Versions 1.0.0

Parse and validate GSMA SGP.22 eSIM activation codes (LPA:1$smdp$matchingid) before they reach an MDM, a QR generator or a device inventory

Policyfile
Berkshelf
Knife
cookbook 'esim_activation', '~> 1.0.0', :supermarket
cookbook 'esim_activation', '~> 1.0.0'
knife supermarket install esim_activation
knife supermarket download esim_activation
README
Dependencies
Changelog

esim_activation

A small Chef cookbook for checking eSIM activation codes before they end up
in a device inventory, an MDM enrolment payload or a QR generator. It parses
the GSMA SGP.22 activation-code string, tells you exactly what is wrong when
a device would reject it, and can write a de-duplicated, normalised list of
good codes to disk.

What an activation code looks like

SGP.22 (section 4.1) defines the string behind every eSIM QR code and behind
the "enter details manually" screen on iOS and Android:

LPA:1$$[$[$]]
Field Rule enforced here
LPA:1 Fixed prefix (case-insensitive). LPA:2 or anything else is rejected
SM-DP+ address A host name with at least two labels. Schemes (https://), ports, paths, bare IPs and localhost are rejected. Lower-cased on output
matching ID Up to 255 characters, no whitespace or control characters. May be empty for profiles that are pushed to the device
SM-DP+ OID Optional dotted OID such as 1.3.6.1.4.1.99999.1
confirmation code flag Optional, and only the value 1 is valid. It means the user must also type a confirmation code

The usual copy-and-paste faults it catches: a leading https://, a trailing
space or newline, a space inside the matching ID from a wrapped e-mail, and a
$ swapped for a S or 5 by OCR.

Usage

Library (recipes, custom resources, anywhere)

code = EsimActivation::Lpa.parse('LPA:1$smdp.example.com$ABCD-EFGH-1234')
code.smdp                        # => "smdp.example.com"
code.matching_id                 # => "ABCD-EFGH-1234"
code.confirmation_code_required  # => false
code.to_s                        # => "LPA:1$smdp.example.com$ABCD-EFGH-1234"

EsimActivation::Lpa.valid?('LPA:1$https://smdp.example.com$X')        # => false
EsimActivation::Lpa.reject_reason('LPA:1$https://smdp.example.com$X')
# => "SM-DP+ address \"https://smdp.example.com\" is not a valid host name"

Inside recipes and resources the module is also available as esim_lpa.

Recipe esim_activation::default

Checks node['esim_activation']['codes'] and logs a warning for each code a
device would reject. Set strict to true to fail the run instead.

default['esim_activation']['codes']  = ['LPA:1$smdp.example.com$ABCD-EFGH-1234']
default['esim_activation']['strict'] = true

Resource esim_activation_inventory

Writes the normalised codes, one per line, to a file (mode 0600 by default,
because an activation code is a one-time credential until the profile is
installed). Invalid codes are skipped with a warning, or fail the run with
strict true.

esim_activation_inventory '/etc/fleet/esim_codes' do
  codes [
    'LPA:1$smdp.example.com$ABCD-EFGH-1234',
    'lpa:1$SMDP.Example.com$ABCD-EFGH-1234',   # duplicate after normalising
    'LPA:1$rsp.example.net$K2-3F5-9X$$1'
  ]
  strict false
end

Where these codes come from

Any consumer or travel eSIM store issues one per order. Stores that take
crypto at checkout, such as an
eSIM that accepts crypto
without an account, deliver the same string by e-mail or on the order page,
so the same checks apply. Disclosure: this cookbook is maintained by the team
behind that store; nothing in the cookbook talks to it.

Testing

ruby test/unit/lpa_test.rb

The tests cover valid codes, the OID and confirmation-code fields, round
tripping, and each rejection rule.

License

MIT. See LICENSE.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

esim_activation CHANGELOG

1.0.0

  • Initial release: SGP.22 activation-code parser, esim_lpa helper, default recipe, esim_activation_inventory resource.
Copyright © 2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

Progress and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.
See Trademarksfor appropriate markings. All rights in any other trademarks contained herein are reserved by their respective owners and their inclusion does not imply an endorsement, affiliation, or sponsorship as between Progress and the respective owners.

Code of Conduct Terms and Conditions of Use Privacy Policy Cookie Policy Trademark Policy Status