mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Add missing token auth to access token findOne fn
This commit is contained in:
@@ -57,6 +57,12 @@ export const identityAccessTokenDALFactory = (db: TDbClient) => {
|
|||||||
`${TableName.IdentityOidcAuth}.identityId`
|
`${TableName.IdentityOidcAuth}.identityId`
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
.leftJoin(TableName.IdentityOidcAuth, (qb) => {
|
||||||
|
qb.on(`${TableName.Identity}.authMethod`, db.raw("?", [IdentityAuthMethod.TOKEN_AUTH])).andOn(
|
||||||
|
`${TableName.Identity}.id`,
|
||||||
|
`${TableName.IdentityTokenAuth}.identityId`
|
||||||
|
);
|
||||||
|
})
|
||||||
.select(selectAllTableCols(TableName.IdentityAccessToken))
|
.select(selectAllTableCols(TableName.IdentityAccessToken))
|
||||||
.select(
|
.select(
|
||||||
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityUniversalAuth).as("accessTokenTrustedIpsUa"),
|
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityUniversalAuth).as("accessTokenTrustedIpsUa"),
|
||||||
@@ -65,6 +71,7 @@ export const identityAccessTokenDALFactory = (db: TDbClient) => {
|
|||||||
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityAzureAuth).as("accessTokenTrustedIpsAzure"),
|
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityAzureAuth).as("accessTokenTrustedIpsAzure"),
|
||||||
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityKubernetesAuth).as("accessTokenTrustedIpsK8s"),
|
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityKubernetesAuth).as("accessTokenTrustedIpsK8s"),
|
||||||
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityOidcAuth).as("accessTokenTrustedIpsOidc"),
|
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityOidcAuth).as("accessTokenTrustedIpsOidc"),
|
||||||
|
db.ref("accessTokenTrustedIps").withSchema(TableName.IdentityTokenAuth).as("accessTokenTrustedIpsToken"),
|
||||||
db.ref("name").withSchema(TableName.Identity)
|
db.ref("name").withSchema(TableName.Identity)
|
||||||
)
|
)
|
||||||
.first();
|
.first();
|
||||||
@@ -79,7 +86,8 @@ export const identityAccessTokenDALFactory = (db: TDbClient) => {
|
|||||||
doc.accessTokenTrustedIpsAws ||
|
doc.accessTokenTrustedIpsAws ||
|
||||||
doc.accessTokenTrustedIpsAzure ||
|
doc.accessTokenTrustedIpsAzure ||
|
||||||
doc.accessTokenTrustedIpsK8s ||
|
doc.accessTokenTrustedIpsK8s ||
|
||||||
doc.accessTokenTrustedIpsOidc
|
doc.accessTokenTrustedIpsOidc ||
|
||||||
|
doc.accessTokenTrustedIpsToken
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new DatabaseError({ error, name: "IdAccessTokenFindOne" });
|
throw new DatabaseError({ error, name: "IdAccessTokenFindOne" });
|
||||||
|
|||||||
Reference in New Issue
Block a user