A bit less obvious for JetConnect flights; you have to hover over the JQ flight number for it to come up saying its operated by JetConnect.
Legal? Why not? Plenty of brands have their product made in various subcontracting or subsidiary factories or hire sub contractors to do the work without the client ever knowing. Not sure why airlines would be different.