53 lines
859 B
Plaintext
53 lines
859 B
Plaintext
include::../description.adoc[]
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
=== Exceptions
|
|
|
|
* The rule ignores string literals that are used directly in Regexp methods.
|
|
|
|
== Sensitive Code Example
|
|
|
|
----
|
|
func connect() {
|
|
user := "root"
|
|
password:= "supersecret" // Sensitive
|
|
|
|
url := "login=" + user + "&passwd=" + password
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
[source,go]
|
|
----
|
|
func connect() {
|
|
user := getEncryptedUser()
|
|
password:= getEncryptedPass() // Compliant
|
|
|
|
url := "login=" + user + "&passwd=" + password
|
|
}
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
include::../parameters.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|