nex-protocols-common-go/ticket-granting
Daniel López Guimaraes 8976a663d5
feat: Implement token validation on TicketGranting and SecureConnection
Add callback function `ValidateLoginData` on the `ticket-granting` and
`secure-connection` common protocols to allow validation of the given
login data on the `LoginEx` or `RegisterEx` methods. Alongside that, add
a toggle on the `secure-connection` common protocol for enabling or
disabling the insecure `Register` method, like the one for `Login` on
`ticket-granting`.

Also implement the Pretendo token validation inside the globals section,
so that both common protocols can use them. The common protocols include
an option to use the Pretendo token validation `SetPretendoValidation`
on that protocol, but custom handling can be added by setting the
callback function to a custom one.

And finally, replace the error handling on the protocols to set any
errors that aren't related to invalid arguments on `%retval%`. This is
accurate as per previous research, since this is where errors like
maintenace or validation failures get populated.

By default, both of the insecure methods are disabled. That means that
current game servers that use the insecure `Register` method will have
to enable them using `EnableInsecureRegister`. Server implementers
**MUST NOT** enable both of the insecure methods at the same time.

The new `SetPretendoValidation` function expects an AES key as an
argument. This matches with the AES key that is stored on the server
list from the account server, after being hex-decoded. Servers are
expected to set the AES key from an environment variable and validate
that the input provided is valid (the key must be decoded using
`hex.DecodeString` before being provided to the validation fucntion).
2025-03-15 18:24:40 +00:00
..
generate_ticket.go chore: Update module version to v2 2024-04-07 23:56:20 +01:00
login.go feat: Implement token validation on TicketGranting and SecureConnection 2025-03-15 18:24:40 +00:00
login_ex.go feat: Implement token validation on TicketGranting and SecureConnection 2025-03-15 18:24:40 +00:00
protocol.go feat: Implement token validation on TicketGranting and SecureConnection 2025-03-15 18:24:40 +00:00
request_ticket.go feat: Implement token validation on TicketGranting and SecureConnection 2025-03-15 18:24:40 +00:00