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

Allow grabbing additional loot #63

Open
kpcyrd opened this issue Aug 2, 2018 · 0 comments
Open

Allow grabbing additional loot #63

kpcyrd opened this issue Aug 2, 2018 · 0 comments

Comments

@kpcyrd
Copy link
Owner

kpcyrd commented Aug 2, 2018

If a script wants to provide additional data of the user, the script could be changed from:

return is_valid

to something like

if is_valid then
    req = http_request(session, 'GET', 'https://example.com/api/permissions', {})
    resp = http_send(req)
    if last_err() then
        -- ignore this error and just report the login as valid instead of requeueing it
        clear_err()
        return true
    end
    loot['permissions'] = resp['text']
    return true
else
    return false
end

badtouch would need to add a dict/table named loot to the lua context before executing the script. After the script finished with success the loot table would be checked and if it's non-empty that data would be included in the report. This is difficult to fit into the regular combolist report we currently use, so we might have to limit this to json reports (and support json reports).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant