tacplus icon indicating copy to clipboard operation
tacplus copied to clipboard

Added ServerSession to HandleAuthorRequest and HandleAcctRequest

Open wladwm opened this issue 5 years ago • 4 comments

In Author/Acct packet we should not trust RemoteAddr field, so we need access to ServerSession to proper authorize and account events.

wladwm avatar Oct 29 '19 14:10 wladwm

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.

nwaples avatar Dec 16 '19 22:12 nwaples

funny i was about to code this change. Would be great to have it merged.

jfdive avatar Aug 17 '21 13:08 jfdive

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)

jfdive avatar Aug 19 '21 09:08 jfdive

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())

wladwm avatar Aug 19 '21 11:08 wladwm