Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #16411: Change the packaging to pass via the Rudder api to install the plugin #219

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
99a3c6d
Fixes #13087: Correction on plugins for parent status check
fanf Jul 27, 2018
b96f318
Merge branch 'bug_13087/correction_on_plugins_for_parent_status_check…
Jul 27, 2018
9a9350c
Fixes #12978: Add TLS cert/key auth to the Vault plugin
victorqrt Jul 18, 2018
b195c7b
Merge branch 'branches/rudder/5.0'
Aug 3, 2018
695242b
Merge branch 'ust_12978/add_tls_cert_key_auth_to_the_vault_plugin_pr'
Aug 3, 2018
94c3afd
Merge branch 'branches/rudder/5.0'
Aug 9, 2018
e54b6f8
Merge branch 'branches/rudder/5.0'
Aug 16, 2018
94388c5
Merge branch 'branches/rudder/5.0'
Aug 24, 2018
80fd248
Merge branch 'branches/rudder/5.0'
VinceMacBuche Aug 24, 2018
22b9a9a
Merge branch 'branches/rudder/5.0'
Aug 31, 2018
fe79cb4
Merge branch 'branches/rudder/5.0'
Aug 31, 2018
7c1caa0
Merge branch 'branches/rudder/5.0'
VinceMacBuche Aug 31, 2018
924dc6f
Merge branch 'branches/rudder/5.0'
Aug 31, 2018
561ecb5
Merge branch 'branches/rudder/5.0'
Aug 31, 2018
83450ef
Merge branch 'branches/rudder/5.0'
Aug 31, 2018
3927f14
Merge branch 'branches/rudder/5.0'
fanf Sep 4, 2018
ddfe2bb
Merge branch 'branches/rudder/5.0'
Sep 17, 2018
506ec5c
Merge branch 'branches/rudder/5.0'
Sep 19, 2018
cbf9510
Merge branch 'branches/rudder/5.0'
VinceMacBuche Sep 19, 2018
0ba5d14
Merge branch 'branches/rudder/5.0'
Sep 24, 2018
61e5a24
update doc
calou45200 Sep 25, 2018
fb9efd0
Merge branch 'branches/rudder/5.0'
Sep 25, 2018
dfee178
Merge branch 'branches/rudder/5.0'
Sep 25, 2018
213807f
Merge branch 'branches/rudder/5.0'
Sep 25, 2018
ee58661
Merge branch 'branches/rudder/5.0'
peckpeck Sep 25, 2018
31beeb5
Merge branch 'branches/rudder/5.0'
Sep 25, 2018
0336791
Merge branch 'branches/rudder/5.0'
Sep 25, 2018
bf2c68a
Merge branch 'branches/rudder/5.0'
peckpeck Sep 25, 2018
db17370
Merge branch 'branches/rudder/5.0'
Sep 25, 2018
577dcdf
Merge branch 'branches/rudder/5.0'
Sep 25, 2018
98d0d79
Merge branch 'branches/rudder/5.0'
peckpeck Sep 26, 2018
e2cb9d0
Merge branch 'branches/rudder/5.0'
Sep 26, 2018
5072864
Merge branch 'branches/rudder/5.0'
peckpeck Sep 26, 2018
1df827c
Merge branch 'patch-1_pr'
Sep 27, 2018
8d6008f
Merge branch 'branches/rudder/5.0'
VinceMacBuche Sep 27, 2018
31facc8
Merge branch 'branches/rudder/5.0'
Sep 28, 2018
e0ee6ce
Merge branch 'branches/rudder/5.0'
peckpeck Sep 28, 2018
2a10d5f
Merge branch 'branches/rudder/5.0'
Sep 28, 2018
52955a3
Merge branch 'branches/rudder/5.0'
Oct 2, 2018
8103410
Merge branch 'branches/rudder/5.0'
Oct 2, 2018
a13f237
Merge branch 'branches/rudder/5.0'
Oct 2, 2018
7ba8ab7
Merge branch 'branches/rudder/5.0'
Oct 3, 2018
5206d08
Merge branch 'branches/rudder/5.0'
Oct 8, 2018
71d71af
Merge branch 'branches/rudder/5.0'
Oct 10, 2018
08dec52
Merge branch 'branches/rudder/5.0'
Oct 11, 2018
336a258
Merge branch 'branches/rudder/5.0'
Oct 17, 2018
cb82f68
Merge branch 'branches/rudder/5.0'
Oct 22, 2018
c310b70
Merge branch 'branches/rudder/5.0'
Oct 23, 2018
bf14172
Merge branch 'branches/rudder/5.0'
Oct 23, 2018
bc50248
Merge branch 'branches/rudder/5.0'
Oct 24, 2018
377a002
Merge branch 'branches/rudder/5.0'
Oct 24, 2018
768a5a8
Merge branch 'branches/rudder/5.0'
Oct 25, 2018
2a591f2
Merge branch 'branches/rudder/5.0'
Oct 25, 2018
190aa7e
Merge branch 'branches/rudder/5.0'
fanf Oct 25, 2018
13beca6
Merge branch 'branches/rudder/5.0'
Oct 26, 2018
7d54b18
Merge branch 'branches/rudder/5.0'
Oct 26, 2018
7fddcae
Merge branch 'branches/rudder/5.0'
Oct 26, 2018
ff53b74
Merge branch 'branches/rudder/5.0'
Oct 26, 2018
5600b41
Merge branch 'branches/rudder/5.0'
Oct 26, 2018
ae7dd59
Merge branch 'branches/rudder/5.0'
Oct 26, 2018
7efd2f3
Merge branch 'branches/rudder/5.0'
Oct 29, 2018
fe9e4c1
Merge branch 'branches/rudder/5.0'
Oct 29, 2018
e5580a7
Merge branch 'branches/rudder/5.0'
Nov 7, 2018
52d24c5
Merge branch 'branches/rudder/5.0'
Nov 12, 2018
ba83828
Merge branch 'branches/rudder/5.0'
Nov 23, 2018
02967eb
Merge branch 'branches/rudder/5.0'
Fdall Nov 26, 2018
93efab2
Merge branch 'branches/rudder/5.0'
Nov 26, 2018
4c5ed92
Merge branch 'branches/rudder/5.0'
Nov 29, 2018
3b8937f
Merge branch 'branches/rudder/5.0'
Nov 29, 2018
ff3708f
Merge branch 'branches/rudder/5.0'
Nov 30, 2018
b607dd2
Merge branch 'branches/rudder/5.0'
Nov 30, 2018
752453b
Merge branch 'branches/rudder/5.0'
Nov 30, 2018
21c320a
Merge branch 'branches/rudder/5.0'
Nov 30, 2018
328b1b8
Merge branch 'branches/rudder/5.0'
fanf Dec 7, 2018
b2c0909
Merge branch 'branches/rudder/5.0'
amousset Jan 7, 2019
6b05537
Merge branch 'branches/rudder/5.0'
peckpeck Jan 16, 2019
0e18b83
Merge branch 'branches/rudder/5.0'
Jan 21, 2019
b9c3398
Merge branch 'branches/rudder/5.0'
Feb 11, 2019
4fde4cc
Merge branch 'branches/rudder/5.0'
Feb 12, 2019
5506a72
Merge branch 'branches/rudder/5.0'
Feb 15, 2019
30e146b
Merge branch 'branches/rudder/5.0'
Feb 22, 2019
8643a20
Merge branch 'branches/rudder/5.0'
Feb 22, 2019
467da25
Merge branch 'branches/rudder/5.0'
Mar 27, 2019
a02231d
Merge branch 'branches/rudder/5.0'
Apr 3, 2019
d1bda41
Merge branch 'branches/rudder/5.0'
Apr 4, 2019
f66d95b
Merge branch 'branches/rudder/5.0'
Apr 4, 2019
2368bb2
Merge branch 'branches/rudder/5.0'
Apr 4, 2019
9081f1e
Merge branch 'branches/rudder/5.0'
Apr 5, 2019
d78ce7c
Merge branch 'branches/rudder/5.0'
Apr 8, 2019
74653f8
Merge branch 'branches/rudder/5.0'
Apr 10, 2019
92b13c4
Merge branch 'branches/rudder/5.0'
May 2, 2019
fec3a5e
Merge branch 'branches/rudder/5.0'
May 3, 2019
636f624
Merge branch 'branches/rudder/5.0'
May 23, 2019
564d612
Merge branch 'branches/rudder/5.0'
fanf Jun 5, 2019
cd5e9f7
Merge branch 'branches/rudder/5.0'
Jun 14, 2019
d7e7216
Merge branch 'branches/rudder/5.0'
Jun 17, 2019
6acf26f
Merge branch 'branches/rudder/5.0'
Jun 18, 2019
923084e
Merge branch 'branches/rudder/5.0'
Jul 3, 2019
566b09c
Merge branch 'branches/rudder/5.0'
Jul 9, 2019
ef7caa2
Merge branch 'branches/rudder/5.0'
Jul 10, 2019
9fa3a44
Merge branch 'branches/rudder/5.0'
Jul 10, 2019
d8834e4
Merge branch 'branches/rudder/5.0'
Jul 11, 2019
8e5f320
Fixes #15273: Take care of number of nodes in plugin license check
fanf Jul 23, 2019
2a43576
Merge branch 'branches/rudder/5.0'
fanf Jul 25, 2019
0648a16
Merge branch 'branches/rudder/5.0'
Jul 26, 2019
dee7a5d
Merge branch 'branches/rudder/5.0'
fanf Jul 29, 2019
07ad903
Merge branch 'branches/rudder/5.0'
fanf Jul 30, 2019
9628bfb
Merge branch 'branches/rudder/5.0'
Aug 1, 2019
a3567da
Merge branch 'branches/rudder/5.0'
Aug 2, 2019
6e831f4
Merge branch 'branches/rudder/5.0'
Aug 2, 2019
aedf993
Fixes #15468: Fix tests in plugins for branch 5.1
ncharles Aug 14, 2019
564aca4
Merge branch 'branches/rudder/5.0'
Aug 28, 2019
f23c34d
Merge branch 'branches/rudder/5.0'
Aug 29, 2019
3ee0e19
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
Sep 3, 2019
61d2b3d
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
Sep 16, 2019
261b98b
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
Sep 16, 2019
25d2a66
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
VinceMacBuche Sep 17, 2019
615f948
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
Sep 19, 2019
7e1f054
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
Sep 25, 2019
c736a37
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
Sep 30, 2019
4e49734
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
Oct 1, 2019
2e71ff6
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
Oct 2, 2019
2c3287c
Merge branch 'branches/rudder/5.0' into branches/rudder/5.1
Oct 2, 2019
115d8cc
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Oct 3, 2019
29092c8
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Oct 8, 2019
3b0e6ac
Setup 6.0 branch
VinceMacBuche Oct 11, 2019
af9ef2c
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
VinceMacBuche Oct 21, 2019
f1ccdd8
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Normation-Quality-Assistant Oct 21, 2019
639b6d6
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
VinceMacBuche Oct 23, 2019
08864e5
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Oct 24, 2019
88721aa
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Oct 28, 2019
96ffda0
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Nov 6, 2019
d23aca8
Fixes #16132: Update change validation and hello world to Rudder 6.0
fanf Nov 6, 2019
a574708
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Nov 13, 2019
9646fbe
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Nov 13, 2019
10b34ea
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Nov 13, 2019
5384860
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Nov 13, 2019
d27fbda
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Nov 13, 2019
b1ddd5c
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Nov 14, 2019
4285fe2
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Nov 15, 2019
2ff0fbe
Fixes #16131: Datasources is not compatible with Rudder 6.0
fanf Nov 18, 2019
72a23d1
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Nov 25, 2019
e926c0e
Fixes #16351: Plugins don't compile anymore
fanf Dec 5, 2019
a08f2ec
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Normation-Quality-Assistant Dec 7, 2019
2d63c1b
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
fanf Dec 7, 2019
ca0a7f6
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
fanf Dec 7, 2019
6ca3b2e
Fixes #16370: Release plugin for 6.0
fanf Dec 7, 2019
db848b1
Set correct value for plugin parent (release version)
VinceMacBuche Dec 8, 2019
3b836e1
Tagging plugin 1.5 of api-authorizations
VinceMacBuche Dec 8, 2019
41a2cd9
next version 1.6 of plugin api-authorizations
VinceMacBuche Dec 8, 2019
f5d5f47
Tagging plugin 1.3 of auth-backends
VinceMacBuche Dec 8, 2019
ff29964
next version 1.4 of plugin auth-backends
VinceMacBuche Dec 8, 2019
3f7babf
Tagging plugin 1.4 of branding
VinceMacBuche Dec 9, 2019
862380c
next version 1.5 of plugin branding
VinceMacBuche Dec 9, 2019
6b6cb8c
Tagging plugin 1.4 of change-validation
VinceMacBuche Dec 9, 2019
d8cca7e
next version 1.5 of plugin change-validation
VinceMacBuche Dec 9, 2019
f1b166e
Tagging plugin 1.1 of create-node-api
VinceMacBuche Dec 9, 2019
1a59ccb
next version 1.2 of plugin create-node-api
VinceMacBuche Dec 9, 2019
1316ca6
Tagging plugin 1.6 of datasources
VinceMacBuche Dec 9, 2019
a5da95c
next version 1.7 of plugin datasources
VinceMacBuche Dec 9, 2019
643fe4e
Tagging plugin 1.6 of node-external-reports
VinceMacBuche Dec 9, 2019
432f90b
next version 1.7 of plugin node-external-reports
VinceMacBuche Dec 9, 2019
b2956d2
Tagging plugin 1.2 of scale-out-relay
VinceMacBuche Dec 9, 2019
ff18930
next version 1.3 of plugin scale-out-relay
VinceMacBuche Dec 9, 2019
d18e0a1
Tagging plugin 1.3 of user-management
VinceMacBuche Dec 9, 2019
dfde29e
next version 1.4 of plugin user-management
VinceMacBuche Dec 9, 2019
de5ef48
Tagging plugin 1.2 of centreon
VinceMacBuche Dec 9, 2019
4d980c3
next version 1.3 of plugin centreon
VinceMacBuche Dec 9, 2019
875fa6d
Tagging plugin 1.1 of glpi
VinceMacBuche Dec 9, 2019
7dde02b
next version 1.2 of plugin glpi
VinceMacBuche Dec 9, 2019
5eb819a
Tagging plugin 1.1 of vault
VinceMacBuche Dec 9, 2019
006234e
next version 1.2 of plugin vault
VinceMacBuche Dec 9, 2019
b8c07b3
Tagging plugin 1.0 of zabbix
VinceMacBuche Dec 9, 2019
1eded16
next version 1.1 of plugin zabbix
VinceMacBuche Dec 9, 2019
a24fdff
Tagging plugin 1.0 of notify
VinceMacBuche Dec 9, 2019
727ed86
next version 1.1 of plugin notify
VinceMacBuche Dec 9, 2019
d37a5d6
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Dec 9, 2019
825122a
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Dec 9, 2019
181ae34
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Dec 10, 2019
a189dab
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Dec 16, 2019
7939fd7
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Dec 17, 2019
93f3898
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Dec 17, 2019
685df81
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
ElaadF Jan 10, 2020
1a8044e
Tagging plugin 1.4 of user-management
VinceMacBuche Jan 10, 2020
c3dd7e6
next version 1.5 of plugin user-management
VinceMacBuche Jan 10, 2020
3013436
Merge branch 'branches/rudder/5.0' into branches/rudder/6.0
Jan 13, 2020
3cc3875
Fixes #16535: Missing scheme error when adding an user from the UI
ElaadF Jan 13, 2020
732f1d8
Tagging plugin 1.5 of user-management
ElaadF Jan 14, 2020
c0936c8
next version 1.6 of plugin user-management
ElaadF Jan 14, 2020
b3ef238
Fixes #16296: Updating informations by submitting empty fields invali…
ElaadF Jan 15, 2020
b83f8eb
Fixes #16562: Port plugins to scala 2.13
fanf Jan 15, 2020
d030b73
Fixes #16566: Reload users configuration file from the UI
ElaadF Jan 16, 2020
26160cf
Fixes #16103: Add a CIS category and put everything in it
VinceMacBuche Jan 22, 2020
9fafe8f
Fixes #16600: miss a change in postinst to not add gm twice
VinceMacBuche Jan 22, 2020
bf0ecc9
Fixes #16411: Change the packaging to pass via the Rudder api to inst…
Fdall Dec 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ It may happens that at some point in the Rudder maintenance cycle, a Rudder mino
breaking change in a plugin API or a binary incompability in a plugin ABI. In such a case, we will
explain which plugin versions are compatible with which Rudder versions in plugin readme file.

=== Summary of binary compatibility for Rudder 5.0 branch
=== Summary of binary compatibility for Rudder 6.0 branch

Please see file: version-compat.adoc

Expand Down
2 changes: 1 addition & 1 deletion api-authorizations/build.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for API tokens.</p>"""
# - x.y(.z): plugin major.minor.micro. Micro should be omitted. When omitted, z is assumed to be 0.
# For the build, we split the information between two properties, rudder branch and plugin version,
# which must be concaneted with "-" to build the plugin version.
plugin-branch=1.5
plugin-branch=1.6-SNAPSHOT

# rudder branch comes from parent
plugin-version=${rudder-branch}-${plugin-branch}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
package com.normation.plugins.apiauthorizations

import com.normation.plugins.PluginEnableImpl
import com.normation.rudder.services.nodes.NodeInfoService

final class CheckRudderPluginEnableImpl() extends PluginEnableImpl
final class CheckRudderPluginEnableImpl(nodeInfoService: NodeInfoService) extends PluginEnableImpl

Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@
package com.normation.plugins.apiauthorizations

import com.normation.plugins.LicensedPluginCheck
import com.normation.rudder.services.nodes.NodeInfoService

final class CheckRudderPluginEnableImpl() extends LicensedPluginCheck {
final class CheckRudderPluginEnableImpl(nodeInfoService: NodeInfoService) extends LicensedPluginCheck {
// here are processed variables
def pluginResourcePublickey = "${plugin-resource-publickey}"
def pluginResourceLicense = "${plugin-resource-license}"
def pluginDeclaredVersion = "${plugin-declared-version}"
def pluginId = "${plugin-fullname}"

override def getNumberOfNodes: Int = nodeInfoService.getNumberOfManagedNodes
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class AclLevel(status: PluginStatus) extends ApiAuthorizationLevelService {
*/
object ApiAuthorizationsConf extends RudderPluginModule {
// by build convention, we have only one of that on the classpath
lazy val pluginStatusService = new CheckRudderPluginEnableImpl()
lazy val pluginStatusService = new CheckRudderPluginEnableImpl(RudderConfig.nodeInfoService)

// override default service level
RudderConfig.apiAuthorizationLevelService.overrideLevel(new AclLevel(pluginStatusService))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import net.liftweb.json._
import org.joda.time.DateTime
import com.normation.rudder.rest.{UserApi => API}


import com.normation.box._

class UserApi(
restExtractor : RestExtractorService
Expand Down Expand Up @@ -87,7 +87,7 @@ class UserApi(
val schema = API.GetApiToken
val restExtractor = api.restExtractor
def process0(version: ApiVersion, path: ApiPath, req: Req, params: DefaultParams, authzToken: AuthzToken): LiftResponse = {
readApi.getById(ApiAccountId(authzToken.actor.name)) match {
readApi.getById(ApiAccountId(authzToken.actor.name)).toBox match {
case Full(Some(token)) =>
val accounts: JValue = ("accounts" -> JArray(List(token.toJson)))
RestUtils.toJsonResponse(None, accounts)(schema.name, true)
Expand Down Expand Up @@ -119,7 +119,7 @@ class UserApi(
, now
)

writeApi.save(account, ModificationId(uuidGen.newUuid), authzToken.actor) match {
writeApi.save(account, ModificationId(uuidGen.newUuid), authzToken.actor).toBox match {
case Full(token) =>
val accounts: JValue = ("accounts" -> JArray(List(token.toJson)))
RestUtils.toJsonResponse(None,accounts)(schema.name, true)
Expand All @@ -135,7 +135,7 @@ class UserApi(
val schema = API.DeleteApiToken
val restExtractor = api.restExtractor
def process0(version: ApiVersion, path: ApiPath, req: Req, params: DefaultParams, authzToken: AuthzToken): LiftResponse = {
writeApi.delete(ApiAccountId(authzToken.actor.name), ModificationId(uuidGen.newUuid), authzToken.actor) match {
writeApi.delete(ApiAccountId(authzToken.actor.name), ModificationId(uuidGen.newUuid), authzToken.actor).toBox match {
case Full(token) =>
val accounts: JValue = ("accounts" -> ("id" -> token.value))
RestUtils.toJsonResponse(None,accounts)(schema.name, true)
Expand All @@ -151,7 +151,7 @@ class UserApi(
val schema = API.UpdateApiToken
val restExtractor = api.restExtractor
def process0(version: ApiVersion, path: ApiPath, req: Req, params: DefaultParams, authzToken: AuthzToken): LiftResponse = {
readApi.getById(ApiAccountId(authzToken.actor.name)) match {
readApi.getById(ApiAccountId(authzToken.actor.name)).toBox match {
case Full(Some(token)) =>
val accounts: JValue = ("accounts" -> JArray(List(token.toJson)))
RestUtils.toJsonResponse(None, accounts)(schema.name, true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
package com.normation.plugins.authbackends

import com.normation.plugins.PluginEnableImpl
import com.normation.rudder.services.nodes.NodeInfoService

/*
* The class will be loaded by ServiceLoader, it needs an empty constructor.
*/

final class CheckRudderPluginEnableImpl() extends PluginEnableImpl
final class CheckRudderPluginEnableImpl(nodeInfoService: NodeInfoService) extends PluginEnableImpl

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
package com.normation.plugins.authbackends

import com.normation.plugins.LicensedPluginCheck
import com.normation.rudder.services.nodes.NodeInfoService

/*
* This template file will processed at build time to choose
Expand All @@ -46,11 +47,13 @@ import com.normation.plugins.LicensedPluginCheck
*
* The class will be loaded by ServiceLoader, it needs an empty constructor.
*/
final class CheckRudderPluginEnableImpl() extends LicensedPluginCheck {
final class CheckRudderPluginEnableImpl(nodeInfoService: NodeInfoService) extends LicensedPluginCheck {
// here are processed variables
def pluginResourcePublickey = "${plugin-resource-publickey}"
def pluginResourceLicense = "${plugin-resource-license}"
def pluginDeclaredVersion = "${plugin-declared-version}"
def pluginId = "${plugin-fullname}"
}

override def getNumberOfNodes: Int = nodeInfoService.getNumberOfManagedNodes
}

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import com.normation.plugins.authbackends.api.AuthBackendsApiImpl
object AuthBackendsConf extends RudderPluginModule {

// by build convention, we have only one of that on the classpath
lazy val pluginStatusService = new CheckRudderPluginEnableImpl()
lazy val pluginStatusService = new CheckRudderPluginEnableImpl(RudderConfig.nodeInfoService)

lazy val authBackendsProvider = new AuthBackendsProvider {
def authenticationBackends = Set("ldap", "radius")
Expand Down
4 changes: 4 additions & 0 deletions branding/pom-template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
</plugins>
</build>

<dependencies>
<!-- Add other plugin specific dependencies -->
</dependencies>

<!-- Below is an horrible if/then/else in maven. You shouldn't have anything to change here -->

<!-- Internal profile: FOR INTERNAL USE ONLY - active if -Dlimited is *not* specified. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
package com.normation.plugins.branding

import com.normation.plugins.PluginEnableImpl
import com.normation.rudder.services.nodes.NodeInfoService

final class CheckRudderPluginEnableImpl() extends PluginEnableImpl
final class CheckRudderPluginEnableImpl(nodeInfoService: NodeInfoService) extends PluginEnableImpl


Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@
package com.normation.plugins.branding

import com.normation.plugins.LicensedPluginCheck
import com.normation.rudder.services.nodes.NodeInfoService

final class CheckRudderPluginEnableImpl() extends LicensedPluginCheck {
final class CheckRudderPluginEnableImpl(nodeInfoService: NodeInfoService) extends LicensedPluginCheck {
// here are processed variables
def pluginResourcePublickey = "${plugin-resource-publickey}"
def pluginResourceLicense = "${plugin-resource-license}"
def pluginDeclaredVersion = "${plugin-declared-version}"
def pluginId = "${plugin-fullname}"

override def getNumberOfNodes: Int = nodeInfoService.getNumberOfManagedNodes
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import com.normation.rudder.rest.{BrandingApi, BrandingApiService}
object BrandingPluginConf extends RudderPluginModule {

// by build convention, we have only one of that on the classpath
lazy val pluginStatusService = new CheckRudderPluginEnableImpl()
lazy val pluginStatusService = new CheckRudderPluginEnableImpl(RudderConfig.nodeInfoService)

import bootstrap.liftweb.{ RudderConfig => Cfg }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ import scala.xml.NodeSeq
class LoginBranding(val status: PluginStatus, version: PluginVersion)(implicit val ttag: ClassTag[Login]) extends PluginExtensionPoint[Login] with Loggable {

def pluginCompose(snippet:Login) : Map[String, NodeSeq => NodeSeq] = Map(
"display" -> display _
).mapValues(guard _)
"display" -> guard(display(_))
)


private [this] val confRepo = BrandingPluginConf.brandingConfService
Expand Down
2 changes: 1 addition & 1 deletion change-validation/build.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugin-web-description=<p>Enable configuration change requests and validation wo
# - x.y(.z): plugin major.minor.micro. Micro should be omitted. When omitted, z is assumed to be 0.
# For the build, we split the information between two properties, rudder branch and plugin version,
# which must be concaneted with "-" to build the plugin version.
plugin-branch=1.4
plugin-branch=1.5-SNAPSHOT

# rudder branch comes from parent
plugin-version=${rudder-branch}-${plugin-branch}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
package com.normation.plugins.changevalidation

import com.normation.plugins.PluginEnableImpl
import com.normation.rudder.services.nodes.NodeInfoService

/*
* The class will be loaded by ServiceLoader, it needs an empty constructor.
*/

final class CheckRudderPluginEnableImpl() extends PluginEnableImpl
final class CheckRudderPluginEnableImpl(nodeInfoService: NodeInfoService) extends PluginEnableImpl

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
package com.normation.plugins.changevalidation

import com.normation.plugins.LicensedPluginCheck
import com.normation.rudder.services.nodes.NodeInfoService

/*
* This template file will processed at build time to choose
Expand All @@ -46,11 +47,13 @@ import com.normation.plugins.LicensedPluginCheck
*
* The class will be loaded by ServiceLoader, it needs an empty constructor.
*/
final class CheckRudderPluginEnableImpl() extends LicensedPluginCheck {
final class CheckRudderPluginEnableImpl(nodeInfoService: NodeInfoService) extends LicensedPluginCheck {
// here are processed variables
def pluginResourcePublickey = "${plugin-resource-publickey}"
def pluginResourceLicense = "${plugin-resource-license}"
def pluginDeclaredVersion = "${plugin-declared-version}"
def pluginId = "${plugin-fullname}"
}

override def getNumberOfNodes: Int = nodeInfoService.getNumberOfManagedNodes
}

Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ import com.normation.rudder.services.workflows.WorkflowService
import net.liftweb.common.Box
import net.liftweb.common.Full


import com.normation.box._

/*
* The validation workflow level
Expand Down Expand Up @@ -191,7 +191,7 @@ class ChangeValidationWorkflowLevelService(
object ChangeValidationConf extends RudderPluginModule {

// by build convention, we have only one of that on the classpath
lazy val pluginStatusService = new CheckRudderPluginEnableImpl()
lazy val pluginStatusService = new CheckRudderPluginEnableImpl(RudderConfig.nodeInfoService)

lazy val roWorkflowRepository = new RoWorkflowJdbcRepository(RudderConfig.doobie)
lazy val woWorkflowRepository = new WoWorkflowJdbcRepository(RudderConfig.doobie)
Expand All @@ -208,8 +208,8 @@ object ChangeValidationConf extends RudderPluginModule {
, roChangeRequestRepository
, woChangeRequestRepository
, () => Full(RudderConfig.workflowLevelService.workflowEnabled)
, RudderConfig.configService.rudder_workflow_self_validation _
, RudderConfig.configService.rudder_workflow_self_deployment _
, () => RudderConfig.configService.rudder_workflow_self_validation.toBox
, () => RudderConfig.configService.rudder_workflow_self_deployment.toBox
)

lazy val supervisedTargetRepo = new SupervisedTargetsReposiory(
Expand Down Expand Up @@ -248,7 +248,7 @@ object ChangeValidationConf extends RudderPluginModule {
)
, new UserValidationNeeded(roValidatedUserRepository)
)
, RudderConfig.configService.rudder_workflow_enabled _
, () => RudderConfig.configService.rudder_workflow_enabled.toBox
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

package com.normation.plugins.changevalidation

import cats.implicits._
import com.normation.eventlog.EventActor
import com.normation.eventlog.ModificationId
import com.normation.rudder.db.Doobie
Expand All @@ -57,6 +56,7 @@ import doobie.postgres.implicits._
import net.liftweb.common.Loggable
import net.liftweb.common._
import org.joda.time.DateTime
import zio.interop.catz._

import scala.xml.Elem

Expand All @@ -66,7 +66,7 @@ class RoChangeRequestJdbcRepository(
) extends RoChangeRequestRepository with Loggable {

import doobie._
import mapper.ChangeRequestComposite
import mapper.ChangeRequestRead


val SELECT_SQL = "SELECT id, name, description, content, modificationId FROM ChangeRequest"
Expand All @@ -75,11 +75,11 @@ class RoChangeRequestJdbcRepository(

//utility method which correctly transform Doobie types towards Box[Vector[ChangeRequest]]
private[this] def execQuery(q: Query0[Box[ChangeRequest]]): Box[Vector[ChangeRequest]] = {
q.to[Vector].attempt.map(
transactRunBox(xa => q.to[Vector].map(
// we are just ignoring change request with unserialisation
// error. Does not seem the best.
_.map(_.flatten.toVector)
).transact(xa).unsafeRunSync
_.flatten.toVector
).transact(xa))
}

override def getAll() : Box[Vector[ChangeRequest]] = {
Expand All @@ -89,7 +89,7 @@ class RoChangeRequestJdbcRepository(

override def get(changeRequestId:ChangeRequestId) : Box[Option[ChangeRequest]] = {
val q = Query[ChangeRequestId, Box[ChangeRequest]](SELECT_SQL + " where id = ?", None).toQuery0(changeRequestId)
q.option.map(_.map(_.toOption)).transact(xa).unsafeRunSync
transactRunBox(xa =>q.option.map(_.flatMap(_.toOption)).transact(xa))

}

Expand Down Expand Up @@ -187,7 +187,7 @@ class WoChangeRequestJdbcRepository(
""".update.withUniqueGeneratedKeys[Int]("id")

for {
id <- (q.transact(xa).attempt.unsafeRunSync: Box[Int])
id <- transactRunBox(xa => q.transact(xa))
cr <- roRepo.get(ChangeRequestId(id)).flatMap {
case None =>
val msg = s"The newly saved change request with ID ${id} was not found back in data base"
Expand Down Expand Up @@ -224,12 +224,12 @@ class WoChangeRequestJdbcRepository(
Failure(msg)
case Some(x) => Full("ok")
}
update <- ({
update <- {
val (name, desc, xml, modId) = getAtom(changeRequest)
val q = sql"""update ChangeRequest set name = ${name}, description = ${desc}, content = ${xml}, modificationId = ${modId}
where id = ${changeRequest.id}"""
q.update.run.transact(xa).attempt.unsafeRunSync
}: Box[Int])
transactRunBox(xa => q.update.run.transact(xa))
}
updated <- roRepo.get(changeRequest.id).flatMap {
case None =>
val msg = s"Couldn't find the updated entry when updating Change Request ${changeRequest.id.value}"
Expand Down Expand Up @@ -306,11 +306,7 @@ class ChangeRequestMapper(
}
}

implicit val ChangeRequestComposite: Composite[Box[ChangeRequest]] = {
Composite[CR].imap(
(t : CR ) => unserialize(t._1, t._2, t._3, t._4, t._5))(
(cr: Box[ChangeRequest]) => serialize(cr) // not sure we really need that, but Doobie force symetry on Composite
)

implicit val ChangeRequestRead: Read[Box[ChangeRequest]] = {
Read[CR].map((t: CR) => unserialize(t._1, t._2, t._3, t._4, t._5))
}
}