This repository has been archived by the owner on Jan 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Added support for storing IP addresses at login #197
Open
Bakk-f4
wants to merge
16
commits into
Snaacky:master
Choose a base branch
from
Bakk-f4:ip-address
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f5fa2f0
Logging ip address
Bakk-f4 6db1b38
Added alembic file
Bakk-f4 b022913
Merge branch 'master' into ip-address
Bakk-f4 760d09e
corrected alembic file location
Bakk-f4 2c70175
Merge branch 'ip-address' of https://github.com/Bakk-f4/dndserver int…
Bakk-f4 81d05df
Merge branch 'master' into ip-address
Snaacky 07b62d8
black formatting
Bakk-f4 ad45783
Merge branch 'ip-address' of https://github.com/Bakk-f4/dndserver int…
Bakk-f4 4c51235
Merge branch 'master' into ip-address
Bakk-f4 3fad280
PR corrections
Bakk-f4 2ab9444
Merge branch 'ip-address' of https://github.com/Bakk-f4/dndserver int…
Bakk-f4 50d3656
Merge branch 'master' into ip-address
Bakk-f4 1eab04f
alembic heads correction
Bakk-f4 517f2e7
Merge branch 'master' into ip-address
Snaacky f076d97
Merge branch 'master' of https://github.com/Snaacky/dndserver into ip…
Bakk-f4 58f384d
Merge branch 'ip-address' of https://github.com/Bakk-f4/dndserver int…
Bakk-f4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Added IPAddress Table | ||
|
||
Revision ID: c3555b3a5332 | ||
Revises: b53c793562c7 | ||
Create Date: 2023-05-16 18:59:05.677516 | ||
|
||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
import sqlalchemy_utils | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "c3555b3a5332" | ||
down_revision = "b53c793562c7" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"ip_addresses", | ||
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False), | ||
sa.Column("address", sa.String(length=45), nullable=False), | ||
sa.Column("account_id", sa.Integer(), nullable=True), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table("ip_addresses") | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,18 @@ def save(self): | |
db.commit() | ||
|
||
|
||
class IPAddress(base): | ||
__tablename__ = "ip_addresses" | ||
|
||
id = Column(Integer, primary_key=True, autoincrement=True) | ||
address = Column(String(45), nullable=False) | ||
account_id = Column(Integer, nullable=True) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're not storing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are storing the time already in another table in PR #186, let me know if you want aswell another timestamp in this table too. I tought it was not usefull to store two times the same info, we can just join the two tables and we get the same result |
||
def save(self): | ||
db.add(self) | ||
db.commit() | ||
|
||
|
||
class Character(base): | ||
__tablename__ = "characters" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table name should be something more along the lines of
user_logins
or something of that nature.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have the login table in PR #186. Let me know which names you prefer for what