func (a *Allocation) RemovePermission(addr net.Addr) {
	a.permissionsLock.Lock()
	defer a.permissionsLock.Unlock()
	fingerprint := addr2IPFingerprint(addr)
	delete(a.permissions, fingerprint)
}
RemovePermission removes the net.Addr's fingerprint from the allocation's permissions
package allocation
import (
	"encoding/binary"
	"net"
	"sync"
	"time"
	"github.com/pion/logging"
	"github.com/pion/stun"
	"github.com/pion/turn/internal/ipnet"
	"github.com/pion/turn/internal/proto"
	"github.com/pkg/errors"
)
type Allocation struct {
	RelayAddr           net.Addr
	Protocol            Protocol
	TurnSocket          net.PacketConn
	RelaySocket         net.PacketConn
	fiveTuple           *FiveTuple
	permissionsLock     sync.RWMutex
	permissions         map[string]*Permission
	channelBindingsLock sync.RWMutex
	channelBindings     []*ChannelBind
	lifetimeTimer       *time.Timer
	closed              chan interface{}
	log                 logging.LeveledLogger
}
func addr2IPFingerprint(addr net.Addr) string {
	switch a := addr.(type) {
	case *net.UDPAddr:
		return a.IP.String()
	case *net.TCPAddr:  
		return a.IP.String()
	}
	return ""  
}
func NewAllocation(turnSocket net.PacketConn, fiveTuple *FiveTuple, log logging.LeveledLogger) *Allocation {
	return &Allocation{
		TurnSocket:  turnSocket,
		fiveTuple:   fiveTuple,
		permissions: make(map[string]*Permission, 64),
		closed:      make(chan interface{}),
		log:         log,
	}
}
func (a *Allocation) GetPermission(addr net.Addr) *Permission {
	a.permissionsLock.RLock()
	defer a.permissionsLock.RUnlock()
	fingerprint := addr2IPFingerprint(addr)
	return a.permissions[fingerprint]
}
func (a *Allocation) AddPermission(p *Permission) {
	fingerprint := addr2IPFingerprint(p.Addr)
	a.permissionsLock.RLock()
	existedPermission, ok := a.permissions[fingerprint]
	a.permissionsLock.RUnlock()
	if ok {
		existedPermission.refresh(permissionTimeout)
		return
	}
	p.allocation = a
	a.permissionsLock.Lock()
	a.permissions[fingerprint] = p
	a.permissionsLock.Unlock()
	p.start(permissionTimeout)
}