-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
move saml-provider-plugin to packages #198184
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good but I've questions
|
||
export const pluginPath = path.resolve(__dirname); | ||
|
||
export * from './helpers/saml_tools'; |
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 this make it harder to use the IDE to see what *
resolves to?
I know using the asterisk makes it easier at development time, but does it make it harder in maintenance?
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.
I don't have strong opinion here. I would like to hear @azasypkin thoughts on it as code owner.
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.
Hmm, I don’t have a strong opinion either, and I’m not particularly concerned about the IDE itself. However, I’m slightly leaning towards explicit exports since it’s easier to see what we export and allows us to export only what we believe needs to be exported, making it easier to maintain.
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.
yeah the maintenance bit is what worries me.
@@ -743,7 +743,7 @@ packages/kbn-rule-data-utils @elastic/security-detections-response @elastic/resp | |||
x-pack/plugins/rule_registry @elastic/response-ops @elastic/obs-ux-management-team | |||
x-pack/plugins/runtime_fields @elastic/kibana-management | |||
packages/kbn-safer-lodash-set @elastic/kibana-security | |||
x-pack/test/security_api_integration/plugins/saml_provider @elastic/kibana-security | |||
packages/kbn-saml-provider-plugin @elastic/kibana-security |
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.
Why not leave this to the jsonc file instead? ..and let the owners file be generated from the jsonc file
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.
good point, removing
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.
I thought we were removing this line? No?
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.
it is auto-added by kibanamachine :)
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.
Looks good to me, thanks! Just left a few minor suggestions.
@@ -0,0 +1,3 @@ | |||
# @kbn/saml-provider-plugin |
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.
question: is there any reason we put this plugin under packages/
and not under x-pack/packages/
? Do we plan to use in any package or test outside of x-pack
?
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.
The new test framework will leave under packages/
, it was the main reason to put this plugin in the same location. I also can't exclude feature rework in kbn-test
/ kbn-es
in relation to this plugin test tools.
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.
Got it, thanks for clarifying, makes sense to me 👍
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.
updated in 804d7af
@@ -0,0 +1,3 @@ | |||
# @kbn/saml-provider-plugin | |||
|
|||
Saml provider plugin for testing purpose |
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.
Tip
Maybe we can name it slightly differently to be more consistent with the existing kbn-mock-idp-plugin
: kbn-mock-test-idp-plugin
or kbn-mock-idp-test-plugin
or kbn-test-idp-plugin
?
Feel free to ignore if it requires too much work to update all the affected files though.
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.
I'm ok with changing it, better now than later 😄
Just to clarify: you think it is better to use idp
in title over saml
?
kbn-test-idp-plugin
sounds good.
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.
Just to clarify: you think it is better to use idp in title over saml?
Yeah, we have two packages that start with kbn-mock-idp-{plugin|test}
and don't mention SAML, so I think it's fine to omit SAML.
import path from 'path'; | ||
|
||
const resourcesPath = path.resolve(__dirname, 'resources'); | ||
export const saml1IdPMetadataPath = path.resolve(resourcesPath, 'idp_metadata.xml'); |
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.
Tip
How about grouping this paths together?
export const IDP_METADATA_PATHS = {
default: path.resolve(resourcesPath, 'metadata.xml'),
saml1: path.resolve(resourcesPath, 'idp_metadata.xml'),
saml2: path.resolve(resourcesPath, 'idp_metadata_2.xml'),
neverLogin: path.resolve(resourcesPath, 'idp_metadata_never_login.xml'),
mockIdpPlugin: ath.resolve(resourcesPath, 'idp_metadata_mock_idp.xml'),
};
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.
Great suggestion, updated in 804d7af
|
||
export const pluginPath = path.resolve(__dirname); | ||
|
||
export * from './helpers/saml_tools'; |
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.
Hmm, I don’t have a strong opinion either, and I’m not particularly concerned about the IDE itself. However, I’m slightly leaning towards explicit exports since it’s easier to see what we export and allows us to export only what we believe needs to be exported, making it easier to maintain.
…na into kbn-saml-provider-plugin
💔 Build Failed
Failed CI StepsHistory
cc @dmlemeshko |
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.
LGTM
Summary
This PR moves saml-provider plugin from
x-pack/test
into kbn package to simplify importing metadata and plugin root path into other packages, as we will keep using it in both FTR and new test framework.Changes are scoped only to plugin + helpers saml tools migration and updating imports.