desec-stack icon indicating copy to clipboard operation
desec-stack copied to clipboard

api: add database trigger to prevent UPDATE on RRset.subname and RRset.type

Open peterthomassen opened this issue 4 years ago • 1 comments

This is for behind-the-scenes safely only (we have no public interface that allows making these changes).

peterthomassen avatar Jul 01 '21 16:07 peterthomassen

decorate RRset class with

@pgtrigger.register(
    pgtrigger.Protect(
        name='protect_updates',
        operation=pgtrigger.Update,
        condition=pgtrigger.Q(old__subname__df=pgtrigger.F('new__subname'))
            | pgtrigger.Q(old__type__df=pgtrigger.F('new__type'))
    )
)

peterthomassen avatar Jul 01 '21 16:07 peterthomassen