mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
Merge 29b0a0a16d into aeede53112
This commit is contained in:
commit
15753c0ea3
2 changed files with 8 additions and 1 deletions
|
|
@ -139,7 +139,13 @@ describe("key ownership", () => {
|
|||
});
|
||||
|
||||
it("leaves the form's user_id alone for another_user", () => {
|
||||
const expected = { key_alias: "my-key", user_id: "someone-else", duration: null, metadata: "{}" };
|
||||
const expected = {
|
||||
key_alias: "my-key",
|
||||
user_id: "someone-else",
|
||||
send_invite_email: true,
|
||||
duration: null,
|
||||
metadata: "{}",
|
||||
};
|
||||
expect(
|
||||
payloadOf(build({ key_alias: "my-key", user_id: "someone-else" }, { keyOwner: "another_user" })),
|
||||
).toStrictEqual(expected);
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ export const buildKeyCreatePayload = (input: KeyCreateInput): KeyPayloadResult =
|
|||
...(values.organization_id === null && { organization_id: undefined }),
|
||||
...(values.project_id === null && { project_id: undefined }),
|
||||
...(input.keyOwner === "you" && { user_id: input.userID }),
|
||||
...(input.keyOwner === "another_user" && { send_invite_email: true }),
|
||||
...(input.keyOwner === "agent" && { agent_id: input.selectedAgentId }),
|
||||
...(input.autoRotationEnabled && { auto_rotate: true, rotation_interval: input.rotationInterval }),
|
||||
duration: !duration || (duration as string).trim() === "" ? null : duration,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue