
When an include is not surrounded by empty lines, its content is inlined on the same line as the adjacent content. That can lead to broken tags and other display issues. This PR fixes all such includes and introduces a validation step that forbids introducing the same problem again.
52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,python]
|
|
----
|
|
import ldap
|
|
|
|
def init_ldap():
|
|
connect = ldap.initialize('ldap://example:1389')
|
|
|
|
connect.simple_bind('cn=root') # Noncompliant
|
|
connect.simple_bind_s('cn=root') # Noncompliant
|
|
connect.bind_s('cn=root', None) # Noncompliant
|
|
connect.bind('cn=root', None) # Noncompliant
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,python]
|
|
----
|
|
import ldap
|
|
import os
|
|
|
|
def init_ldap():
|
|
connect = ldap.initialize('ldap://example:1389')
|
|
|
|
connect.simple_bind('cn=root', os.environ.get('LDAP_PASSWORD')) # Compliant
|
|
connect.simple_bind_s('cn=root', os.environ.get('LDAP_PASSWORD')) # Compliant
|
|
connect.bind_s('cn=root', os.environ.get('LDAP_PASSWORD')) # Compliant
|
|
connect.bind('cn=root', os.environ.get('LDAP_PASSWORD')) # Compliant
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Provide a password when authenticating to this LDAP server.
|
|
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|