fix(ci): Fix Docker images and npm registry URL in CI workflows

This commit is contained in:
2024-10-27 19:50:39 +01:00
parent 320b3ed9eb
commit 8f49f0cb4f
79 changed files with 2052 additions and 823 deletions

View File

@ -18,17 +18,23 @@ export class CloudlyCoreflowManager {
new plugins.typedrequest.TypedHandler('getIdentityByToken', async (requestData) => {
const user = await this.cloudlyRef.authManager.CUser.getInstance({
data: {
tokens: [{
token: requestData.token,
}] // find the proper user here.
} as any
tokens: [
{
token: requestData.token,
},
], // find the proper user here.
} as any,
});
if (!user) {
throw new plugins.typedrequest.TypedResponseError('The supplied token is not valid. No matching user found.');
throw new plugins.typedrequest.TypedResponseError(
'The supplied token is not valid. No matching user found.',
);
}
if (user.data.type !== 'machine') {
throw new plugins.typedrequest.TypedResponseError('The supplied token is not valid. The user is not a machine.');
throw new plugins.typedrequest.TypedResponseError(
'The supplied token is not valid. The user is not a machine.',
);
}
let cluster: Cluster;
if (user.data.role === 'cluster') {
@ -42,18 +48,20 @@ export class CloudlyCoreflowManager {
type: 'machine', // if someone authenticates by token, they are a machine, no matter what.
userId: user.id,
expiresAt: expiryTimestamp,
...(cluster ? {
clusterId: cluster.id,
clusterName: cluster.data.name,
} : {}),
...(cluster
? {
clusterId: cluster.id,
clusterName: cluster.data.name,
}
: {}),
jwt: await this.cloudlyRef.authManager.smartjwtInstance.createJWT({
status: 'loggedIn',
userId: user.id,
expiresAt: expiryTimestamp,
})
}),
},
};
})
}),
);
// lets enable the getting of cluster configs
@ -64,17 +72,14 @@ export class CloudlyCoreflowManager {
const identity = dataArg.identity;
console.log('trying to get clusterConfigSet');
console.log(dataArg);
const cluster =
await this.cloudlyRef.clusterManager.getClusterBy_Identity(
identity
);
const cluster = await this.cloudlyRef.clusterManager.getClusterBy_Identity(identity);
console.log('got cluster config and sending it back to coreflow');
return {
configData: await cluster.createSavableObject(),
deploymentDirectives: [],
};
}
)
},
),
);
// lets enable getting of certificates
@ -84,14 +89,14 @@ export class CloudlyCoreflowManager {
async (dataArg) => {
console.log(`incoming API request for certificate ${dataArg.domainName}`);
const cert = await this.cloudlyRef.letsencryptConnector.getCertificateForDomain(
dataArg.domainName
dataArg.domainName,
);
console.log(`got certificate ready for reponse ${dataArg.domainName}`);
return {
certificate: await cert.createSavableObject(),
};
}
)
},
),
);
}
}