Alexandros Kosiaris has submitted this change and it was merged.

Change subject: cxserver: Add JWT token support
......................................................................


cxserver: Add JWT token support

Bug: T116134
Change-Id: I338070364e5b723274c9627bfae42a1975011a9a
---
M manifests/role/cxserver.pp
M modules/cxserver/manifests/init.pp
M modules/cxserver/templates/config.erb
3 files changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Alexandros Kosiaris: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/cxserver.pp b/manifests/role/cxserver.pp
index a8822cd..9f4b775 100644
--- a/manifests/role/cxserver.pp
+++ b/manifests/role/cxserver.pp
@@ -7,9 +7,11 @@
 
     include ::passwords::cxserver
     $yandex_api_key = $::passwords::cxserver::yandex_api_key
+    $jwt_secret = $::passwords::cxserver::jwt_secret
 
     class { '::cxserver':
         yandex_api_key => $yandex_api_key,
+        jwt_secret     => $jwt_secret,
     }
 
     ferm::service { 'cxserver_http':
diff --git a/modules/cxserver/manifests/init.pp 
b/modules/cxserver/manifests/init.pp
index 4d5584f..8b2dc2d 100644
--- a/modules/cxserver/manifests/init.pp
+++ b/modules/cxserver/manifests/init.pp
@@ -36,6 +36,8 @@
 #   Port where to run the cxserver service. Defaults to 8080.
 # [*registry*]
 #   Registry to use for language pairs for Content Translation.
+# [*jwt_secret*]
+#   JWT secret token
 class cxserver(
     $base_path = '/srv/deployment/cxserver/deploy',
     $node_path = '/srv/deployment/cxserver/deploy/node_modules',
@@ -51,6 +53,7 @@
     $proxy = undef,
     $port = 8080,
     $registry = undef,
+    $jwt_secret = undef,
 ) {
     require_package('nodejs')
 
diff --git a/modules/cxserver/templates/config.erb 
b/modules/cxserver/templates/config.erb
index 65dd7da..ae6e428 100644
--- a/modules/cxserver/templates/config.erb
+++ b/modules/cxserver/templates/config.erb
@@ -31,6 +31,12 @@
        'parsoid.api': '<%= @parsoid %>',
        'restbase.url': '<%= @restbase %>',
        'mt.apertium.api': '<%= @apertium %>',
+       <%- if @jwt_secret -%>
+               jwt: {
+                       secret: '<%= @jwt_secret %>',
+                       algorithms: [ 'HS256' ]
+       },
+       <%- end -%>
        <%- if @yandex_url -%>
        'mt.yandex.api': '<%= @yandex_url %>',
        'mt.yandex.key': '<%= @yandex_api_key %>',

-- 
To view, visit https://gerrit.wikimedia.org/r/247819
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I338070364e5b723274c9627bfae42a1975011a9a
Gerrit-PatchSet: 10
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: KartikMistry <kartik.mis...@gmail.com>
Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to