tacplus
tacplus copied to clipboard
Added ServerSession to HandleAuthorRequest and HandleAcctRequest
In Author/Acct packet we should not trust RemoteAddr field, so we need access to ServerSession to proper authorize and account events.
Sorry for not looking at this earlier. I will probably get to it over Christmas/New year. Im not sure yet I wan't to give the Acct and Author methods access to the ServerSession directly which has Authentication methods.
funny i was about to code this change. Would be great to have it merged.
funny i was about to code this change. Would be great to have it merged.
-> this patch does not work at such if using the library (structures are not exported). -> probably would be good to provide as parameter a struct containing the relevant information that are necessary to be used to implement auth/author/acct functions (in this case local/remote addr for expl)
It works for me.
func (h *CdnHandler) HandleAuthenStart(ctx context.Context, a *tacplus.AuthenStart, s *tacplus.ServerSession) *tacplus.AuthenReply { log.Printf("HandleAuthenStart(%v,%v,%v)\n", ctx, a, s.RemoteAddr())