Skip to content

Commit d9f7125

Browse files
authored
Merge pull request #18 from maxmind/oalders/device-and-session-inputs
Add /device/session_age, /device/session_id and /email/first_seen
2 parents c88aee1 + c54f464 commit d9f7125

File tree

12 files changed

+302
-211
lines changed

12 files changed

+302
-211
lines changed

HISTORY.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ History
55

66
* Added the following new values to the ``/payment/processor`` validation:
77
``ebs``, ``hipay``, and ``lemon_way``.
8+
* Added the following new input values:
9+
``/device/session_age`` and ``/device/session_id``.
10+
* Added support for the ``/email/first_seen`` output.
811

912
1.3.2 (2016-12-08)
1013
++++++++++++++++++

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ Example
107107
>>> 'device': {
108108
>>> 'ip_address': '81.2.69.160',
109109
>>> 'accept_language': 'en-US,en;q=0.8',
110+
>>> 'session_age': 3600,
111+
>>> 'session_id': 'a333a4e127f880d8820e56a66f40717c',
110112
>>> 'user_agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36'
111113
>>> },
112114
>>> 'event': {

docs/conf.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525

2626
# Add any Sphinx extension module names here, as strings. They can be extensions
2727
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
28-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
29-
'sphinx.ext.intersphinx', 'sphinx.ext.coverage']
28+
extensions = [
29+
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx',
30+
'sphinx.ext.coverage'
31+
]
3032

3133
# Add any paths that contain templates here, relative to this directory.
3234
templates_path = ['_templates']
@@ -87,7 +89,6 @@
8789
# A list of ignored prefixes for module index sorting.
8890
#modindex_common_prefix = []
8991

90-
9192
# -- Options for HTML output ---------------------------------------------
9293

9394
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -167,7 +168,6 @@
167168
# Output file base name for HTML help builder.
168169
htmlhelp_basename = 'minfrauddoc'
169170

170-
171171
# -- Options for LaTeX output --------------------------------------------
172172

173173
latex_elements = {
@@ -184,8 +184,8 @@
184184
# Grouping the document tree into LaTeX files. List of tuples
185185
# (source start file, target name, title, author, documentclass [howto/manual]).
186186
latex_documents = [
187-
('index', 'minfraud.tex', 'minfraud Documentation',
188-
'Gregory Oschwald', 'manual'),
187+
('index', 'minfraud.tex', 'minfraud Documentation', 'Gregory Oschwald',
188+
'manual'),
189189
]
190190

191191
# The name of an image file (relative to this directory) to place at the top of
@@ -208,29 +208,24 @@
208208
# If false, no module index is generated.
209209
#latex_domain_indices = True
210210

211-
212211
# -- Options for manual page output --------------------------------------
213212

214213
# One entry per manual page. List of tuples
215214
# (source start file, name, description, authors, manual section).
216-
man_pages = [
217-
('index', 'minfraud', 'minfraud Documentation',
218-
['Gregory Oschwald'], 1)
219-
]
215+
man_pages = [('index', 'minfraud', 'minfraud Documentation',
216+
['Gregory Oschwald'], 1)]
220217

221218
# If true, show URL addresses after external links.
222219
#man_show_urls = False
223220

224-
225221
# -- Options for Texinfo output ------------------------------------------
226222

227223
# Grouping the document tree into Texinfo files. List of tuples
228224
# (source start file, target name, title, author,
229225
# dir menu entry, description, category)
230226
texinfo_documents = [
231-
('index', 'minfraud', 'minfraud Documentation',
232-
'Gregory Oschwald', 'minfraud',
233-
'minFraud Score and Insights web service client.',
227+
('index', 'minfraud', 'minfraud Documentation', 'Gregory Oschwald',
228+
'minfraud', 'minFraud Score and Insights web service client.',
234229
'Miscellaneous'),
235230
]
236231

@@ -243,12 +238,10 @@
243238
# How to display URL addresses: 'footnote', 'no', or 'inline'.
244239
#texinfo_show_urls = 'footnote'
245240

246-
247241
# Example configuration for intersphinx: refer to the Python standard library.
248242
intersphinx_mapping = {
249243
'python': ('http://python.readthedocs.org/en/latest/', None),
250244
'geoip2': ('http://geoip2.readthedocs.org/en/latest/', None)
251245
}
252246

253-
254247
autoclass_content = 'both'

minfraud/models.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ class ScoreIPAddress(object):
212212
"""
213213

214214
__slots__ = ()
215-
_fields = {'risk': None, }
215+
_fields = {
216+
'risk': None,
217+
}
216218

217219

218220
@_inflate_to_namedtuple
@@ -296,6 +298,7 @@ class Device(object):
296298
RFC 3339 date-time.
297299
298300
:type: str | None
301+
299302
"""
300303

301304
__slots__ = ()
@@ -341,6 +344,14 @@ class Disposition(object):
341344
class Email(object):
342345
"""Information about the email address passed in the request.
343346
347+
.. attribute:: first_seen
348+
349+
A date string (e.g. 2017-04-24) to identify the date an email address
350+
was first seen by MaxMind. This is expressed using the ISO 8601 date
351+
format.
352+
353+
:type: str
354+
344355
.. attribute:: is_free
345356
346357
This field is true if MaxMind believes that this email is hosted by a
@@ -360,6 +371,7 @@ class Email(object):
360371

361372
__slots__ = ()
362373
_fields = {
374+
'first_seen': None,
363375
'is_free': None,
364376
'is_high_risk': None,
365377
}

0 commit comments

Comments
 (0)