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 #13026: Removing workflow comet leads to missing user information and session is destroyed #1994

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ object RudderConfig extends Loggable {
, xmlUnserializer
, sectionSpecParser
)
lazy val asyncWorkflowInfo = new AsyncWorkflowInfo
lazy val workflowService: FacadeWorkflowService = FacadeWorkflowService(
new NoWorkflowServiceImpl(
commitAndDeployChangeRequest
Expand Down Expand Up @@ -750,6 +749,7 @@ object RudderConfig extends Loggable {
// Internal APIs
val sharedFileApi = new SharedFilesAPI(restExtractorService,RUDDER_DIR_SHARED_FILES_FOLDER)

lazy val asyncWorkflowInfo = new AsyncWorkflowInfo
lazy val configService: ReadConfigService with UpdateConfigService = {
new LDAPBasedConfigService(
config
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ import JsCmds._
import com.normation.rudder.batch._
import com.normation.rudder.web.components.DateFormaterService
import org.joda.time.DateTime
import com.normation.eventlog.ModificationId
import bootstrap.liftweb.RudderConfig
import bootstrap.liftweb.RudderConfig.clearCacheService
import com.normation.rudder.web.model.CurrentUser

class AsyncDeployment extends CometActor with CometListener with Loggable {

private[this] val asyncDeploymentAgent = RudderConfig.asyncDeploymentAgent
private[this] val uuidGen = RudderConfig.stringUuidGenerator

//current states of the deployment
private[this] var deploymentStatus = DeploymentStatus(NoStatus, IdleDeployer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ class Authz extends DispatchSnippet with Loggable {


def dispatch = {
case "render" => testRight
case "whennorights" => whenNoRights
case "render" => testRight
case "whennorights" => whenNoRights
case "whenhasrights" => whenHasRights
}


/*
* Check if no authorizations are defined for the
* current user - having even one "no_rights"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,27 @@ package com.normation.rudder.web.snippet
import net.liftweb.http.DispatchSnippet
import com.normation.plugins.SpringExtendableSnippet
import com.normation.plugins.SnippetExtensionKey
import com.normation.rudder.domain.logger.ApplicationLogger
import com.normation.rudder.web.model.CurrentUser

import scala.xml.NodeSeq

class CommonLayout extends DispatchSnippet with SpringExtendableSnippet[CommonLayout] {
def extendsAt = SnippetExtensionKey(classOf[CommonLayout].getSimpleName)

def mainDispatch = Map(
"display" -> { x:NodeSeq => x},
"display" -> init
)

/*
* This seems to be needed in top of common layout to correctly init
* the session var just after login.
*/
def init(xml: NodeSeq): NodeSeq = {
CurrentUser.get match {
case None => ApplicationLogger.warn("Authz.init called but user not authenticated")
case Some(_) => //expected
}
xml
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@

</head>
<body data-lift="CommonLayout.display" class="skin-yellow sidebar-mini">

<div class="tw-bs">
<div class="wrapper">
<header class="main-header">
Expand Down Expand Up @@ -299,11 +298,9 @@ <h4 class="panel-title">
</div>

<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- Change request -->
<li class="lift:comet?type=WorkflowInformation" name="workflowInfo" ></li>
<!-- Promise Generation -->
<li class="lift:comet?type=AsyncDeployment" name="deploymentStatus"></li>
<ul class="nav navbar-nav" id="rudder-navbar">
<!-- Promise Generation -->
<li class="lift:comet?type=AsyncDeployment" name="deploymentStatus"></li>
<li class="tasks-menu">
<a target="_blank" href="/rudder-doc">
<i class="fa fa-book"></i>
Expand Down