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

ip token association is awkward #75

Open
zeratax opened this issue Aug 1, 2021 · 0 comments
Open

ip token association is awkward #75

zeratax opened this issue Aug 1, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@zeratax
Copy link
Owner

zeratax commented Aug 1, 2021

Describe the bug
the fix introduced in 4454b3c, is still bad.
the association table currently associates between an ip object and a token object, but since the ip object only has one property it might as well just associate directly between an ip string and the token.

association_table = Table('association', db.Model.metadata,
                          Column('ips', Integer, ForeignKey('ips.id'), primary_key=True),
                          Column('tokens', String(255), ForeignKey('tokens.name'), primary_key=True))

Expected behavior
add alembic version that will recreate the association_table properly. should work very similarly to the last fix:
https://github.com/ZerataX/matrix-registration/blob/4454b3cbf222356e2ef2eda695f5ce9a8431c835/alembic/versions/130b5c2275d8_update_ip_token_association.py#L23-L44

downgrading it will first have to create a new ip table and then recreate an association table with the proper ids to tokens associated

@zeratax zeratax added bug Something isn't working enhancement New feature or request good first issue Good for newcomers labels Aug 1, 2021
@xelantro xelantro added this to the 1.0 milestone Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants