electrode-io / electrode-ota-server

Electrode Over The Air Server for hot deployment of React Native and Cordova mobile apps
Other
204 stars 40 forks source link

new updateCheck API with auth #158

Closed scrajesh closed 4 years ago

scrajesh commented 4 years ago
datvong-wm commented 4 years ago

who's calling /auth/updateCheck ? are they creating a custom ota client? where's the sso part of this code?

jchip commented 4 years ago

So this change basically says, if updateCheck is requested at route /auth/updateCheck for a package that's been listed in CCM as protected, then return 401.

So how does a protected package get authed and goes through? I don't see any code for doing auth work. Is that already existing or something?

scrajesh commented 4 years ago

no tests

added unit tests for isProtected()

added basic tests for the updateCheck route handler

scrajesh commented 4 years ago

So this change basically says, if updateCheck is requested at route /auth/updateCheck for a package that's been listed in CCM as protected, then return 401.

So how does a protected package get authed and goes through? I don't see any code for doing auth work. Is that already existing or something?

Actually if /updateCheck is trying to access a protected package, it issues 401. Auth is implemented in Walmart's instance of the OTA Server.

scrajesh commented 4 years ago

who's calling /auth/updateCheck ? are they creating a custom ota client? where's the sso part of this code?

Yes, it has to be a custom OTA client(will explore more on this). SSO part can be found in Walmart's instance of the OTA Server.