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 #24450: Update API ACL plugin #687

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class ApiAccountsExtension(val status: PluginStatus)(implicit val ttag: ClassTag

def body(xml: NodeSeq): NodeSeq = {
("#acl-app" #>
<div>
<div>
<head_merge>
<link rel="stylesheet" type="text/css" href="/toserve/apiauthorizations/media.css" media="screen" data-lift="with-cached-resource" />
<script type="text/javascript" data-lift="with-cached-resource" src="/toserve/apiauthorizations/rudder-apiauthorizations.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ package com.normation.plugins.apiauthorizations
import com.normation.eventlog.ModificationId
import com.normation.rudder.api._
import com.normation.rudder.apidata.JsonApiAcl
import com.normation.rudder.facts.nodes.NodeSecurityContext
import com.normation.rudder.rest._
import com.normation.rudder.rest.{UserApi => API}
import com.normation.rudder.rest.implicits.ToLiftResponseOne
Expand Down Expand Up @@ -108,7 +109,9 @@ class UserApi(
s"API token for user '${authzToken.qc.actor.name}'",
isEnabled = true,
now,
now
now,
// set "no tenant" - they will be updated dynamically when perms are resolved for that token in AppConfigAuth
NodeSecurityContext.None
)

writeApi
Expand Down Expand Up @@ -258,7 +261,7 @@ object UserApi {
def empty: RestAccountsResponse = RestAccountsResponse(Nil)

/**
* Displays the provided clear-text or hashed token for the api account
* Displays the provided clear-text or hashed token for the api account
*/
def fromUnredacted(account: ApiAccount, secret: String): RestAccountsResponse = {
apply(List(account), Some(ClearTextToken(secret)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class UserApiTest extends Specification with TraitTestApiFromYamlFiles with Logg
"number one user",
isEnabled = true,
creationDate = accountCreationDate,
tokenGenerationDate = accountCreationDate
tokenGenerationDate = accountCreationDate,
NodeSecurityContext.All
)
)

Expand Down