-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add support for fine-grained access control #514
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ import { join } from 'path'; | |
import { CloudwatchAgent } from '../constructs/cloudwatch-agent'; | ||
import { AgentNodeConfig, AgentNodeNetworkProps, AgentNodeProps } from './agent-node-config'; | ||
import { EnvConfig } from './env-config'; | ||
import { AuthConfig } from './auth-config'; | ||
import { AuthConfig, FineGrainedAccessSpecs } from './auth-config'; | ||
import { ViewsConfig } from './views'; | ||
|
||
interface HttpConfigProps { | ||
|
@@ -51,6 +51,7 @@ interface LoginAuthProps { | |
readonly authCredsSecretsArn: string; | ||
readonly authType: string; | ||
readonly adminUsers?: string[]; | ||
readonly fineGrainedAccessSpecs?: FineGrainedAccessSpecs[]; | ||
} | ||
|
||
interface DataRetentionProps { | ||
|
@@ -452,7 +453,8 @@ export class JenkinsMainNode { | |
agentNodeObject: AgentNodeConfig, props: AgentNodeNetworkProps, agentNode: AgentNodeProps[], macAgent: string): string { | ||
let updatedConfig = agentNodeObject.addAgentConfigToJenkinsYaml(stack, agentNode, props, macAgent); | ||
if (loginAuthProps.authType !== 'default') { | ||
updatedConfig = AuthConfig.addOidcConfigToJenkinsYaml(updatedConfig, loginAuthProps.authType, loginAuthProps.adminUsers); | ||
updatedConfig = AuthConfig.addOidcConfigToJenkinsYaml(updatedConfig, loginAuthProps.authType, | ||
loginAuthProps.adminUsers, loginAuthProps.fineGrainedAccessSpecs); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will admins have all the permissions defined in above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Admin users will have admin permissions. Same applies for readonly users. The roles are divided into 2 types. global and items at jenkins level. Admin and readonly falls under |
||
} | ||
if (jenkinsMainNodeProps.envVarsFilePath !== '' && jenkinsMainNodeProps.envVarsFilePath != null) { | ||
updatedConfig = EnvConfig.addEnvConfigToJenkinsYaml(updatedConfig, jenkinsMainNodeProps.envVarsFilePath); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
!== undefined
better than=== true
or similar?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both have different purpose. One checks if value is undefined and other one checks if value is truly assigned to the variable.