For https://github.com/fleetdm/fleet/issues/37261 Changes: - Added a new database model: `FleetInstanceUsingVpp` - Added `/api/vpp/v1/register`: An API endpoint that validates provided Fleet license keys, creates a database record for the proxy registration, and returns a generated secret used to authenticate requests to the other VPP proxy endpoint - Added `/api/vpp/v1/metadata/:storeRegion`: An API endpoint that forwards requests to the `https://api.ent.apple.com/v1/catalog/${storeRegion}/stoken-authenticated-apps` Apple API with a token generated using Fleet's Apple developer credentials. --------- Co-authored-by: Ian Littman <iansltx@gmail.com>
40 lines
1.3 KiB
JavaScript
Vendored
40 lines
1.3 KiB
JavaScript
Vendored
/**
|
|
* InstanceUsingVpp.js// TODO: better name.
|
|
*
|
|
* @description :: A model definition represents a database table/collection.
|
|
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
|
|
*/
|
|
|
|
module.exports = {
|
|
|
|
attributes: {
|
|
|
|
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
|
|
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
|
|
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
|
|
fleetInstanceUrl: {
|
|
type: 'string',
|
|
required: true,
|
|
description: 'The URL of a Fleet instance that is using the fleet website VPP proxy.'
|
|
},
|
|
|
|
fleetServerSecret: {
|
|
type: 'string',
|
|
required: true,
|
|
description: 'A generated secret used to autheticate & identify requests from a particular Fleet instance.'
|
|
},
|
|
|
|
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
|
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
|
|
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
|
|
|
|
|
|
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
|
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
|
|
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
|
|
|
|
},
|
|
|
|
};
|
|
|