{"id":314547,"date":"2020-12-09T03:00:26","date_gmt":"2020-12-09T03:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=314547"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=314547","title":{"rendered":"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Vault \u0438 Pydantic"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ah\/u5\/6w\/ahu56w9mdtquhwghainxbsbbo5q.jpeg\" alt=\"image\"><\/p>\n<p>  <\/p>\n<h1 id=\"predislovie\">\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u044f\u0437\u043a\u0438 Vault (KV \u0438 \u043f\u043e\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0442.\u0435. \u0431\u0435\u0437 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432) \u0438 Pydantic (Settings) \u043f\u043e\u0434 \u043f\u0430\u0442\u0440\u043e\u043d\u0430\u0436\u0435\u043c <a href=\"https:\/\/github.com\/LemegetonX\/sitri\" rel=\"nofollow\">Sitri<\/a>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 superapp \u0441 \u0437\u0430\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438 \u0432 Vault \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e approle, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c (\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 policies \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0435\u043a\u0440\u0435\u0442-\u044d\u043d\u0436\u0430\u0439\u043d\u0430\u043c \u0438 \u043a \u0441\u0430\u043c\u0438\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u043c \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0437\u0430 \u043a\u0430\u0434\u0440\u043e\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c):<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Key                        Value ---                        ----- bind_secret_id             true local_secret_ids           false policies                   [superapp_service] secret_id_bound_cidrs      &lt;nil&gt; secret_id_num_uses         0 secret_id_ttl              0s token_bound_cidrs          [] token_explicit_max_ttl     0s token_max_ttl              30m token_no_default_policy    false token_num_uses             50 token_period               0s token_policies             [superapp_service] token_ttl                  20m token_type                 default<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u041f\u0440\u0438\u043c.:<\/em> \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0432 \u0431\u043e\u0435\u0432\u043e\u0439 \u0440\u0435\u0436\u0438\u043c, \u0442\u043e secret_id_ttl \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c, \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044f 0 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>  <\/p>\n<p>SuperApp \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a kafka \u0438 <a href=\"https:\/\/faust.readthedocs.io\" rel=\"nofollow\">faust<\/a> \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432.<\/p>\n<p>  <\/p>\n<h1 id=\"podgotovim-sitri\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c Sitri<\/h1>\n<p>  <\/p>\n<p>\u0412 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0435\u0441\u0442\u044c <a href=\"https:\/\/sitri.readthedocs.io\/en\/latest\/advanced_usage.html#vault-kv-setting-example\" rel=\"nofollow\">\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/a>, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 vault-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440, \u043e\u0434\u043d\u0430\u043a\u043e, \u043e\u043d \u043d\u0435 \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0435\u0433\u043a\u043e.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c vault-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0432 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <em>provider_config.py<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import hvac    from sitri.providers.contrib.vault import VaultKVConfigProvider   from sitri.providers.contrib.system import SystemConfigProvider    configurator = SystemConfigProvider(prefix=&quot;superapp&quot;)   ENV = configurator.get(&quot;env&quot;)    def vault_client_factory() -&gt; hvac.Client:       client = hvac.Client(url=configurator.get(&quot;vault_api&quot;))        client.auth_approle(           role_id=configurator.get(&quot;role_id&quot;),     secret_id=configurator.get(&quot;secret_id&quot;),     )        return client    provider = VaultKVConfigProvider(       vault_connector=vault_client_factory, mount_point=f&quot;{configurator.get('app_name')}\/{ENV}&quot;   )<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0434\u043e\u0441\u0442\u0430\u0451\u043c \u0438\u0437 \u0441\u0440\u0435\u0434\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a vault, \u0442.\u0435. \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">export SUPERAPP_ENV=dev export SUPERAPP_APP_NAME=superapp export SUPERAPP_VAULT_API=https:\/\/your-vault-host.domain export SUPERAPP_ROLE_ID=535b268d-b858-5fb9-1e3e-79068ca77e27 # \u041f\u0440\u0438\u043c\u0435\u0440 export SUPERAPP_SECRET_ID=243ab423-12a2-63dc-3d5d-0b95b1745ccf # \u041f\u0440\u0438\u043c\u0435\u0440<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 mount_point \u043a \u0432\u0430\u0448\u0438\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u043c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u043c\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0438\u043c\u044f \u0441\u0440\u0435\u0434\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 <em>SUPERAPP_ENV<\/em>. \u041f\u0443\u0442\u044c \u0434\u043e \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0432 settings-\u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0434\u0430\u043b\u0435\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0435 <em>secret_path<\/em> \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u043c.<\/p>\n<p>  <\/p>\n<h1 id=\"klassy-nastroek\">\u041a\u043b\u0430\u0441\u0441\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a<\/h1>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u043f\u043e \u043f\u0443\u043d\u043a\u0442\u0430\u043c \u0438 \u0440\u0430\u0437\u043d\u0435\u0441\u0451\u043c \u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a (\u0411\u0414, Kafka, Faust) \u043f\u043e \u0442\u0440\u0451\u043c \u0440\u0430\u0437\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c.<\/p>\n<p>  <\/p>\n<h2 id=\"nastroyki-bd\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0411\u0414<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">from pydantic import Field    from sitri.settings.contrib.vault import VaultKVSettings    from superapp.config.provider_config import provider    class DBSettings(VaultKVSettings):       user: str = Field(..., vault_secret_key=&quot;username&quot;)       password: str = Field(...)       host: str = Field(...)       port: int = Field(...)        class Config:           provider = provider           default_secret_path = &quot;db&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043a\u043e\u043d\u0444\u0438\u0433. \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u0443 \u043d\u0430\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0435\u043a\u0440\u0435\u0442 <em>superapp\/dev\/db<\/em>, \u0442\u0430\u043a, \u043a\u0430\u043a \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 config \u043a\u043b\u0430\u0441\u0441\u0435, \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 pydantic \u043f\u043e\u043b\u044f, \u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043d\u0438\u0445 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 extra-\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <em>vault_secret_key<\/em> \u2014 \u043e\u043d \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u044e\u0447 \u0432 \u0441\u0435\u043a\u0440\u0435\u0442\u0435 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0441 pydantic \u043f\u043e\u043b\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0442\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044f. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043d\u0430\u0448\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u0441\u0435\u043a\u0440\u0435\u0442\u0435 <em>superapp\/dev\/db<\/em>, \u0435\u0441\u0442\u044c \u043a\u043b\u044e\u0447\u0438 password \u0438 username, \u043d\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0431\u044b\u043b \u043f\u043e\u043c\u0435\u0449\u0451\u043d \u0432 \u043f\u043e\u043b\u0435 user \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432 \u0432\u044b\u0448\u0435\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u043a\u0440\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;host&quot;: &quot;testhost&quot;,   &quot;password&quot;: &quot;testpassword&quot;,   &quot;port&quot;: &quot;1234&quot;,   &quot;username&quot;: &quot;testuser&quot; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437 \u0442\u0440\u043e\u0439\u043a\u0438, \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">db_settings = DBSettings() pprint(db_settings.dict()) # -&gt;  # { #     &quot;host&quot;: &quot;testhost&quot;, #     &quot;password&quot;: &quot;testpassword&quot;, #     &quot;port&quot;: 1234, #     &quot;user&quot;: &quot;testuser&quot; # }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"nastroyki-kafka\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Kafka<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">from typing import Dict, Any    from pydantic import Field    from sitri.settings.contrib.vault import VaultKVSettings    from superapp.config.provider_config import provider, configurator    class KafkaSettings(VaultKVSettings):       mechanism: str = Field(..., vault_secret_key=&quot;auth_mechanism&quot;)       brokers: str = Field(...)       auth_data: Dict[str, Any] = Field(...)        class Config:           provider = provider           default_secret_path = &quot;kafka&quot;           default_mount_point = f&quot;{configurator.get('app_name')}\/common&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043a\u0430\u0444\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0440\u0435\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043e\u0434\u0438\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0435\u043a\u0440\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 <em>superapp\/common\/kafka<\/em><\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;auth_data&quot;: &quot;{\\&quot;password\\&quot;: \\&quot;testpassword\\&quot;, \\&quot;username\\&quot;: \\&quot;testuser\\&quot;}&quot;,   &quot;auth_mechanism&quot;: &quot;SASL_PLAINTEXT&quot;,   &quot;brokers&quot;: &quot;kafka:\/\/test&quot; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u0439\u043c\u0451\u0442 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 Dict[str, Any] \u0438 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442 \u0435\u0433\u043e \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043d\u0430\u0448\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0431\u0443\u0434\u0443\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{     &quot;auth_data&quot;:     {         &quot;password&quot;: &quot;testpassword&quot;,         &quot;username&quot;: &quot;testuser&quot;     },     &quot;brokers&quot;: &quot;kafka:\/\/test&quot;,     &quot;mechanism&quot;: &quot;SASL_PLAINTEXT&quot; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0436\u0435, \u0435\u0441\u043b\u0438 \u0441\u0435\u043a\u0440\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0434\u0430\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 json, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;auth_data&quot;: {     &quot;password&quot;: &quot;testpassword&quot;,     &quot;username&quot;: &quot;testuser&quot;   },   &quot;auth_mechanism&quot;: &quot;SASL_PLAINTEXT&quot;,   &quot;brokers&quot;: &quot;kafka:\/\/test&quot; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0442\u043e\u0436\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<p>P.S.<br \/>  \u0422\u0430\u043a \u0436\u0435, secret_path \u0438 mount_point \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u043e\u043b\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f). \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u0446\u0438\u0442\u0430\u0442\u0443 \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0443\u0442\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u0438 \u0442\u043e\u0447\u043a\u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<blockquote><p>Secret path prioritization:  <\/p>\n<ol>\n<li>vault_secret_path (Field arg)<\/li>\n<li>default_secret_path (Config class field)<\/li>\n<li>secret_path (provider initialization optional arg)<\/li>\n<\/ol>\n<p>  Mount point prioritization:  <\/p>\n<ol>\n<li>vault_mount_point (Field arg)<\/li>\n<li>default_mount_point (Config class field)<\/li>\n<li>mount_point (provider initialization optional arg)<\/li>\n<\/ol>\n<p>  <\/p><\/blockquote>\n<p>  <\/p>\n<h2 id=\"nastroyki-faust-i-otdelnyh-vorkerov\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Faust \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">from typing import Dict    from pydantic import Field, BaseModel    from sitri.settings.contrib.vault import VaultKVSettings    from superapp.config.provider_config import provider    class AgentConfig(BaseModel):       partitions: int = Field(...)       concurrency: int = Field(...)    class FaustSettings(VaultKVSettings):       app_name: str = Field(...)       default_partitions_count: int = Field(..., vault_secret_key=&quot;partitions_count&quot;)       default_concurrency: int = Field(..., vault_secret_key=&quot;agent_concurrency&quot;)       agents: Dict[str, AgentConfig] = Field(default=None, vault_secret_key=&quot;agents_specification&quot;)        class Config:           provider = provider           default_secret_path = &quot;faust&quot;<\/code><\/pre>\n<p>  <\/p>\n<p><em>superapp\/dev\/faust<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;agent_concurrency&quot;: &quot;5&quot;,   &quot;app_name&quot;: &quot;superapp-workers&quot;,   &quot;partitions_count&quot;: &quot;10&quot; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b-\u0432\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 \u0432 \u043a\u0430\u0444\u043a\u0435 \u0438 concurrency \u0434\u043b\u044f \u0430\u0433\u0435\u043d\u0442\u043e\u0432. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430\u0448\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">{   &quot;agents&quot;: None,   &quot;app_name&quot;: &quot;superapp-workers&quot;,   &quot;default_concurrency&quot;: 5,   &quot;default_partitions_count&quot;: 10 }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0430\u0433\u0435\u043d\u0442 <em>X<\/em> \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">{   &quot;partitions&quot;: 5,   &quot;concurrency&quot;: 2 }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0448 \u0441\u0435\u043a\u0440\u0435\u0442 \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;agent_concurrency&quot;: &quot;5&quot;,   &quot;agents_specification&quot;: {     &quot;X&quot;: {       &quot;concurrency&quot;: &quot;2&quot;,       &quot;partitions&quot;: &quot;5&quot;     }   },   &quot;app_name&quot;: &quot;superapp-workers&quot;,   &quot;partitions_count&quot;: &quot;10&quot; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0441\u043c\u0430\u043f\u0438\u043b\u0438\u0441\u044c \u0438 \u0442\u0438\u043f\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0431\u044b\u043b\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u044b \u0442\u0430\u043a, \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 <em>AgentConfig<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">{     &quot;agents&quot;:     {         &quot;X&quot;:         {             &quot;concurrency&quot;: 2,             &quot;partitions&quot;: 5         }     },     &quot;app_name&quot;: &quot;superapp-workers&quot;,     &quot;default_concurrency&quot;: 5,     &quot;default_partitions_count&quot;: 10 }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"sovmeschaem-v-edinyy-konfig-klass\">\u0421\u043e\u0432\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u043a\u043b\u0430\u0441\u0441<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">from pydantic import BaseModel, Field    from superapp.config.database_settings import DBSettings   from superapp.config.faust_settings import FaustSettings   from superapp.config.kafka_settings import KafkaSettings    class AppSettings(BaseModel):       db: DBSettings = Field(default_factory=DBSettings)       faust: FaustSettings = Field(default_factory=FaustSettings)       kafka: KafkaSettings = Field(default_factory=KafkaSettings)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u043d\u0430\u0448\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 \u043e\u0434\u043d\u0443 \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 default_factory \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0431\u043e\u0440\u0430 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430\u0448 \u043a\u043e\u0434 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u0441\u0451 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from superapp.config import AppSettings    config = AppSettings()    print(config)   print(config.dict())<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u0432\u0441\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">db=DBSettings(user='testuser', password='testpassword', host='testhost', port=1234)  faust=FaustSettings(app_name='superapp-workers', default_partitions_count=10, default_concurrency=5, agents={'X': AgentConfig(partitions=5, concurrency=2)})  kafka=KafkaSettings(mechanism='SASL_PLAINTEXT', brokers='kafka:\/\/test', auth_data={'password': 'testpassword', 'username': 'testuser'})<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">{     &quot;db&quot;:     {         &quot;host&quot;: &quot;testhost&quot;,         &quot;password&quot;: &quot;testpassword&quot;,         &quot;port&quot;: 1234,         &quot;user&quot;: &quot;testuser&quot;     },     &quot;faust&quot;:     {         &quot;agents&quot;:         {             &quot;X&quot;:             {                 &quot;concurrency&quot;: 2,                 &quot;partitions&quot;: 5             }         },         &quot;app_name&quot;: &quot;superapp-workers&quot;,         &quot;default_concurrency&quot;: 5,         &quot;default_partitions_count&quot;: 10     },     &quot;kafka&quot;:     {         &quot;auth_data&quot;:         {             &quot;password&quot;: &quot;testpassword&quot;,             &quot;username&quot;: &quot;testuser&quot;         },         &quot;brokers&quot;: &quot;kafka:\/\/test&quot;,         &quot;mechanism&quot;: &quot;SASL_PLAINTEXT&quot;     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0447\u0430\u0441\u0442\u044c\u0435, \u0440\u0430\u0434\u043e\u0441\u0442\u044c, \u0432\u043e\u0441\u0442\u043e\u0440\u0433!<\/p>\n<p>  <\/p>\n<p>\u0423 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0442\u0435\u0441\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">superapp \u251c\u2500\u2500 config \u2502   \u251c\u2500\u2500 app_settings.py \u2502   \u251c\u2500\u2500 database_settings.py \u2502   \u251c\u2500\u2500 faust_settings.py \u2502   \u251c\u2500\u2500 __init__.py \u2502   \u251c\u2500\u2500 kafka_settings.py \u2502   \u2514\u2500\u2500 provider_config.py \u251c\u2500\u2500 __init__.py \u2514\u2500\u2500 main.py<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"posleslovie\">\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430 \u0441 Sitri, \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0451 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0447\u0451\u0442\u043a\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043d\u0430\u043c \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 vault \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u043b\u0438\u0431\u044b, \u043a\u043e\u0434\u0430 \u0438\u043b\u0438 \u043e\u0431\u0449\u0438\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043b\u044e\u0431\u043e\u043c\u0443 \u043e\u0442\u0437\u044b\u0432\u0443!<\/p>\n<p>  <\/p>\n<p>P.S. \u041a\u043e\u0434 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0437\u0430\u043b\u0438\u043b \u043d\u0430 github \u2014 <a href=\"https:\/\/github.com\/Egnod\/article_sitri_vault_pydantic\" rel=\"nofollow\">https:\/\/github.com\/Egnod\/article_sitri_vault_pydantic<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/532032\/\"> https:\/\/habr.com\/ru\/post\/532032\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ah\/u5\/6w\/ahu56w9mdtquhwghainxbsbbo5q.jpeg\" alt=\"image\"><\/p>\n<p>  <\/p>\n<h1 id=\"predislovie\">\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u044f\u0437\u043a\u0438 Vault (KV \u0438 \u043f\u043e\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0442.\u0435. \u0431\u0435\u0437 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432) \u0438 Pydantic (Settings) \u043f\u043e\u0434 \u043f\u0430\u0442\u0440\u043e\u043d\u0430\u0436\u0435\u043c <a href=\"https:\/\/github.com\/LemegetonX\/sitri\" rel=\"nofollow\">Sitri<\/a>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-314547","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/314547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=314547"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/314547\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=314547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=314547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=314547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}