janiussyafiq commented on code in PR #13762:
URL: https://github.com/apache/apisix/pull/13762#discussion_r3688885495


##########
apisix/plugins/ldap-auth-advanced.lua:
##########
@@ -0,0 +1,390 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+local core = require("apisix.core")
+local schema_def = require("apisix.schema_def")
+local auth_utils = require("apisix.utils.auth")
+local consumer_mod = require("apisix.consumer")
+local ldap_client = require("resty.ldap.client")
+local ldap_protocol = require("resty.ldap.protocol")
+local ldap_filter = require("resty.ldap.filter")
+local ngx = ngx
+local ipairs = ipairs
+local type = type
+local ngx_decode_base64 = ngx.decode_base64
+local ngx_re_match = ngx.re.match
+local str_find = string.find
+local str_sub = string.sub
+local parse_addr = core.utils.parse_addr
+
+-- RFC 4512 attribute-description: a descriptor ("cn", "sAMAccountName") or a
+-- numeric OID ("1.2.840.113556.1.4.656"), either optionally followed by
+-- ";option" suffixes ("cn;lang-en", "1.2.840.113556.1.4.656;binary").
+local ATTR_PATTERN = "^(?:[A-Za-z][A-Za-z0-9-]*"
+                     .. "|(?:0|[1-9][0-9]*)(?:\\.(?:0|[1-9][0-9]*))+)"
+                     .. "(?:;[A-Za-z0-9-]+)*$"
+
+local schema = {
+    type = "object",
+    title = "work with route or service object",
+    properties = {
+        -- connection
+        ldap_uri     = { type = "string" },                        -- 
"host[:port]"
+        use_ldaps    = { type = "boolean", default = false },
+        use_starttls = { type = "boolean", default = false },
+        ssl_verify   = { type = "boolean", default = true },
+        timeout      = { type = "integer", minimum = 1, maximum = 60000,
+                         default = 3000 },                          -- 
milliseconds

Review Comment:
   fixed



##########
apisix/plugins/ldap-auth-advanced.lua:
##########
@@ -0,0 +1,390 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+local core = require("apisix.core")
+local schema_def = require("apisix.schema_def")
+local auth_utils = require("apisix.utils.auth")
+local consumer_mod = require("apisix.consumer")
+local ldap_client = require("resty.ldap.client")
+local ldap_protocol = require("resty.ldap.protocol")
+local ldap_filter = require("resty.ldap.filter")
+local ngx = ngx
+local ipairs = ipairs
+local type = type
+local ngx_decode_base64 = ngx.decode_base64
+local ngx_re_match = ngx.re.match
+local str_find = string.find
+local str_sub = string.sub
+local parse_addr = core.utils.parse_addr
+
+-- RFC 4512 attribute-description: a descriptor ("cn", "sAMAccountName") or a
+-- numeric OID ("1.2.840.113556.1.4.656"), either optionally followed by
+-- ";option" suffixes ("cn;lang-en", "1.2.840.113556.1.4.656;binary").
+local ATTR_PATTERN = "^(?:[A-Za-z][A-Za-z0-9-]*"
+                     .. "|(?:0|[1-9][0-9]*)(?:\\.(?:0|[1-9][0-9]*))+)"
+                     .. "(?:;[A-Za-z0-9-]+)*$"
+
+local schema = {
+    type = "object",
+    title = "work with route or service object",
+    properties = {
+        -- connection
+        ldap_uri     = { type = "string" },                        -- 
"host[:port]"

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to