Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-recaptcha Reference Manual, version 2.0.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 15:14:31 2021 GMT+0.
• Introduction | What cl-recaptcha is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
cl-recaptcha is a simple interconnection between recaptcha.com and common-lisp. It can be used for the trivial usage of the recaptcha service.
cl-recaptcha requires cl-ppcre, flexi-streams, jsown and drakma. This library is available via quicklisp.
(ql:quickload :cl-recaptcha)
The simplest way to use cl-recaptcha is to get a public and private key from "https://www.google.com/recaptcha/intro/index.html". Set the key in cl-recaptcha, insert the needed code in your site and ask cl-recaptcha for verification. All this should look somewhat like this:
(setf cl-recaptcha:*site-key* "your-site-key")
(setf cl-recaptcha:*secret-key* "your-secret-key")
In the source of the page, insert a call to challenge where you want to have your recaptcha inserted.
;; Javascript enabled version
(challenge-js)
or
;; Javascript with a noscript tag
(challenge-ns)
Assuming you get your post-vars by (get-post-var "varname") and the ip of the user by (get-ip-address), you can check the validity of the entry of the user by running:
(verify-captcha (get-post-var "g-recaptcha-response") (get-ip-address))
Please note that the ip address is an optional parameter, as it is not required by the recaptcha API call itself.
The verify-captcha
function will return T
on success and nil
on failure. The second value it returns specifies the reason why the challenge was rejected. The result is returned as a list, however the error is usually a single string.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-recaptcha system |
Aad Versteden <madnificent@gmail.com>
Aad Versteden <madnificent@gmail.com>
MIT
Trivial support for the recaptcha service
2.0.0
cl-recaptcha.asd (file)
code.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cl-recaptcha.asd file | ||
• The cl-recaptcha/code.lisp file |
Next: The cl-recaptcha/code․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-recaptcha.asd
cl-recaptcha (system)
Previous: The cl-recaptcha․asd file, Up: Lisp files [Contents][Index]
cl-recaptcha (system)
code.lisp
*captcha-verify-url* (special variable)
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cl-recaptcha.sysdef package | ||
• The cl-recaptcha package |
Next: The cl-recaptcha package, Previous: Packages, Up: Packages [Contents][Index]
cl-recaptcha.asd
Previous: The cl-recaptcha․sysdef package, Up: Packages [Contents][Index]
code.lisp (file)
*captcha-verify-url* (special variable)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported functions |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
The source of the javascript file, the standard value comes from recaptcha itself and should be available in any case
code.lisp (file)
Secret key for the recaptcha service. This is mainly used server side to validate the challenge resopnse. Register at https://www.google.com/recaptcha/intro/index.html
code.lisp (file)
Site key for the recaptcha service. This is public facing and will appear in the div element that holds the recaptcha form. Register at https://www.google.com/recaptcha/intro/index.html
code.lisp (file)
Previous: Exported special variables, Up: Exported definitions [Contents][Index]
This is the javascript-enabled version of the challenge, recaptcha advises you to use this.
code.lisp (file)
This is the javascript-disabled version of the challenge. Google does not recommend it’s use if Javascript is a requirement for your site
code.lisp (file)
Verifies the result the user gave. There are two values returned. The first indicates the success or failure, the second indicates the error code the captcha-server gave. Errors are returned in a list (just as the original JSON response returns errors in an array).
code.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
This is the URL that will be used to verify the result of the captcha. This is the one recaptcha provides
code.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | C F V |
---|
Jump to: | C F V |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P S |
---|
Jump to: | C P S |
---|