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

feat: support more type to admin/config/set #2063

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

jiuker
Copy link
Contributor

@jiuker jiuker commented Apr 7, 2024

feat: support more type to admin/config/set

add identity_ldap, notify_elasticsearch support.

How to test it:
pkg/utils/miniojob/minioJob_test.go should cover it.

{
			name: "notify_mysql",
			args: map[string]string{
				"webhookName": "notify_mysql",
				"dsn_string":  "username:password@tcp(mysql.example.com:3306)/miniodb",
				"table":       "minioevents",
				"format":      "namespace",
			},
			expectCommand:    "myminio notify_mysql dsn_string=\"username:password@tcp(mysql.example.com:3306)/miniodb\" format=\"namespace\" table=\"minioevents\"",
			expectFileNumber: 0,
		},
		{
			name: "notify_amqp",
			args: map[string]string{
				"webhookName": "notify_amqp:primary",
				"url":         "user:password@amqp://amqp-endpoint.example.net:5672",
			},
			expectCommand:    "myminio notify_amqp:primary url=\"user:password@amqp://amqp-endpoint.example.net:5672\"",
			expectFileNumber: 0,
		},
		{
			name: "notify_elasticsearch",
			args: map[string]string{
				"webhookName": "notify_elasticsearch:primary",
				"url":         "user:password@https://elasticsearch-endpoint.example.net:9200",
				"index":       "bucketevents",
				"format":      "namespace",
			},
			expectCommand:    "myminio notify_elasticsearch:primary format=\"namespace\" index=\"bucketevents\" url=\"user:password@https://elasticsearch-endpoint.example.net:9200\"",
			expectFileNumber: 0,
		},
		{
			name: "identity_ldap",
			args: map[string]string{
				"webhookName":             "identity_ldap",
				"enabled":                 "true",
				"server_addr":             "ad-ldap.example.net/",
				"lookup_bind_dn":          "cn=miniolookupuser,dc=example,dc=net",
				"lookup_bind_dn_password": "userpassword",
				"user_dn_search_base_dn":  "dc=example,dc=net",
				"user_dn_search_filter":   "(&(objectCategory=user)(sAMAccountName=%s))",
			},
			expectCommand: "myminio identity_ldap enabled=\"true\" lookup_bind_dn=\"cn=miniolookupuser,dc=example,dc=net\" lookup_bind_dn_password=\"userpassword\" server_addr=\"ad-ldap.example.net/\" user_dn_search_base_dn=\"dc=example,dc=net\" user_dn_search_filter=\"(&(objectCategory=user)(sAMAccountName=%s))\"",
		},

feat: support more type to admin/config/set
Copy link
Contributor

@cniackz cniackz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@harshavardhana harshavardhana merged commit be17c70 into minio:master Apr 11, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants