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
"""Verify a HMAC authorization header using Flask | |
This is how to verify an HMAC authorization header against the body of | |
a request using Flask. | |
When I was creating a Flask app to support a Microsoft Teams outgoing | |
webhook I had some difficulty finding examples or tutorials. I found | |
some example code from Microsoft in Node.js and one in C#. I spent a | |
few hours carefully reading through it and converting the process to | |
Python. Hopefully my posting this as a gist can save some other people |
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
class Cell: | |
ADJACENT = [ | |
(x, y) | |
for x in range(-1, 2) | |
for y in range(-1, 2) | |
if x or y | |
] | |
EMPTY = '_' | |
BLACK = 'B' |
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
from django.contrib import admin | |
from django.contrib.auth.admin import GroupAdmin, UserAdmin as BaseUserAdmin | |
from django.contrib.auth.models import Group as BaseGroup | |
from django.utils.translation import gettext_lazy as _ | |
from .models import Group, User | |
admin.site.unregister(BaseGroup) | |
admin.site.register(Group, GroupAdmin) |