//go:build !integration package login import ( "os" "path/filepath" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func settingsPath(home string) string { return filepath.Join(home, ".m2", "settings.xml") } func wantServerBlock(alias, token string) string { return wantServerBlockIndented(" ", alias, token) } // wantServerBlockIndented renders the expected block at an arbitrary // indentation, for the fixtures that don't use the two-space convention. func wantServerBlockIndented(indent, alias, token string) string { return indent + "\n" + indent + " " + alias + "\n" + indent + " __token__\n" + indent + " " + token + "\n" + indent + "\n" } func TestLoginMaven_CreatesFileWhenAbsent(t *testing.T) { home := t.TempDir() setHome(t, home) require.NoError(t, loginMaven("", "my-alias", "tok1")) want := "\n" + " \n" + wantServerBlock("my-alias", "tok1") + " \n" + "\n" got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) assert.Equal(t, want, string(got)) fileInfo, err := os.Stat(settingsPath(home)) require.NoError(t, err) assert.Equal(t, os.FileMode(0o600), fileInfo.Mode().Perm()) dirInfo, err := os.Stat(filepath.Join(home, ".m2")) require.NoError(t, err) assert.Equal(t, os.FileMode(0o700), dirInfo.Mode().Perm()) } func TestLoginMaven_PreservesUnrelatedContent(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + " \n" + wantServerBlock("other-server", "other-secret") + " \n" + " \n" + " \n" + " central-mirror\n" + " https://mirror.example.com/repo\n" + " central\n" + " \n" + " \n" + " \n" + "\n" require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) require.NoError(t, loginMaven("", "my-alias", "tok1")) got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) content := string(got) assert.Contains(t, content, wantServerBlock("other-server", "other-secret")) assert.Contains(t, content, "") assert.Contains(t, content, "central-mirror") assert.Contains(t, content, "https://mirror.example.com/repo") assert.Contains(t, content, "") assert.Contains(t, content, wantServerBlock("my-alias", "tok1")) } func TestLoginMaven_UpdatesExistingAliasInPlace(t *testing.T) { home := t.TempDir() setHome(t, home) require.NoError(t, loginMaven("", "my-alias", "tok1")) require.NoError(t, loginMaven("", "my-alias", "tok2")) got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) content := string(got) assert.Equal(t, 1, strings.Count(content, "my-alias"), "must not duplicate the entry") assert.Contains(t, content, "tok2") assert.NotContains(t, content, "tok1") } func TestLoginMaven_DifferentAliasAddsSeparateEntry(t *testing.T) { home := t.TempDir() setHome(t, home) require.NoError(t, loginMaven("", "alias-one", "tok1")) require.NoError(t, loginMaven("", "alias-two", "tok2")) got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) content := string(got) assert.Contains(t, content, wantServerBlock("alias-one", "tok1")) assert.Contains(t, content, wantServerBlock("alias-two", "tok2")) assert.Equal(t, 1, strings.Count(content, "alias-one")) assert.Equal(t, 1, strings.Count(content, "alias-two")) } func TestLoginMaven_AddsServersSectionWhenAbsent(t *testing.T) { home := t.TempDir() setHome(t, home) // A settings.xml holding only is common, and used to fail with // "no closing tag found", leaving the user to hand-edit XML. fixture := "\n" + " \n" + " \n" + " central-mirror\n" + " \n" + " \n" + "\n" require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) require.NoError(t, loginMaven("", "my-alias", "tok1")) want := "\n" + " \n" + " \n" + " central-mirror\n" + " \n" + " \n" + " \n" + wantServerBlock("my-alias", "tok1") + " \n" + "\n" got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) assert.Equal(t, want, string(got)) } // TestLoginMaven_InsertedBlockFollowsSectionIndentation pins that a block // inserted before an existing inherits that line's indentation, // rather than a hardcoded four spaces that would leave the block misaligned // with its siblings in a tab-indented file. func TestLoginMaven_InsertedBlockFollowsSectionIndentation(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + "\t\n" + "\t\n" + "\n" require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) require.NoError(t, loginMaven("", "my-alias", "tok1")) want := "\n" + "\t\n" + wantServerBlockIndented("\t ", "my-alias", "tok1") + "\t\n" + "\n" got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) assert.Equal(t, want, string(got)) } // TestLoginMaven_EscapesTokenAsXMLText covers a token carrying characters that // are markup in XML text content. Writing them literally would produce a // settings.xml Maven rejects, and one whose element these regexes // could no longer replace on the next refresh. func TestLoginMaven_EscapesTokenAsXMLText(t *testing.T) { home := t.TempDir() setHome(t, home) require.NoError(t, loginMaven("", "my-alias", "a&bd")) got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) assert.Contains(t, string(got), "a&b<c>d") // A refresh over the escaped block must still find and replace it, rather // than adding a second for the same alias. require.NoError(t, loginMaven("", "my-alias", "tok2")) got, err = os.ReadFile(settingsPath(home)) require.NoError(t, err) content := string(got) assert.Contains(t, content, "tok2") assert.NotContains(t, content, "a&b<c>d") assert.Equal(t, 1, strings.Count(content, "my-alias")) } // TestLoginMaven_EscapesTokenWhenAddingCredentialsToExistingBlock covers the // other write path for a token: setMavenServerChild inserting a // into a user's existing block, which escapes separately from // mavenServerBlock. func TestLoginMaven_EscapesTokenWhenAddingCredentialsToExistingBlock(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + " \n" + " \n" + " my-alias\n" + " \n" + " \n" + "\n" require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) require.NoError(t, loginMaven("", "my-alias", "a&b")) got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) assert.Contains(t, string(got), "a&b") } func TestLoginMaven_ExpandsSelfClosingServers(t *testing.T) { home := t.TempDir() setHome(t, home) // is valid and means "no servers configured", but it carries no // closing tag to insert a block before. fixture := "\n" + " \n" + "\n" require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) require.NoError(t, loginMaven("", "my-alias", "tok1")) want := "\n" + " \n" + wantServerBlock("my-alias", "tok1") + " \n" + "\n" got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) assert.Equal(t, want, string(got)) } // TestLoginMaven_LeavesFileIntactOnError pins that an unusable settings.xml is // never partially rewritten: the caller can fix the file by hand and retry. func TestLoginMaven_LeavesFileIntactOnError(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n \n\n" require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) err := loginMaven("", "my-alias", "tok1") require.ErrorContains(t, err, "") got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) assert.Equal(t, fixture, string(got), "the file must be left byte-for-byte intact") } // TestLoginMaven_RefusesToAddASecondServersSection covers a element // whose tags share a line: neither the nor the pattern // can place a block in it, and adding a whole new section would leave the file // with two elements, which is invalid. func TestLoginMaven_RefusesToAddASecondServersSection(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n \n\n" require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) err := loginMaven("", "my-alias", "tok1") require.ErrorContains(t, err, "cannot edit") got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) assert.Equal(t, fixture, string(got)) assert.Equal(t, 1, strings.Count(string(got), "")) } // TestLoginMaven_PreservesUserAddedChildrenOnRefresh covers the token-refresh // case: replacing the whole block with the canonical four lines would // silently drop everything the user added to it. func TestLoginMaven_PreservesUserAddedChildrenOnRefresh(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + " \n" + " \n" + " my-alias\n" + " __token__\n" + " tok1\n" + " \n" + " 660\n" + " \n" + " \n" + " \n" + " X-Custom\n" + " 1\n" + " \n" + " \n" + " \n" + " \n" + " \n" + "\n" require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) require.NoError(t, loginMaven("", "my-alias", "tok2")) got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) content := string(got) assert.Contains(t, content, "tok2") assert.NotContains(t, content, "tok1") assert.Contains(t, content, "") assert.Contains(t, content, "660") assert.Contains(t, content, "X-Custom") assert.Equal(t, 1, strings.Count(content, "my-alias")) } // TestLoginMaven_AddsCredentialsToBlockWithoutThem covers a block a // user created with only an , for example while setting up a mirror. func TestLoginMaven_AddsCredentialsToBlockWithoutThem(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + " \n" + " \n" + " my-alias\n" + " \n" + " \n" + "\n" require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) require.NoError(t, loginMaven("", "my-alias", "tok1")) got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) assert.Equal(t, "\n"+ " \n"+ wantServerBlock("my-alias", "tok1")+ " \n"+ "\n", string(got)) } // TestLoginMaven_UpdatingSecondAliasPreservesFirst guards against a regex // that finds alias-two by lazily scanning from the *first* // tag in the file: if alias-two's block isn't the first one, // such a regex spans across alias-one's whole block to reach alias-two's // , and replacing that span silently deletes alias-one's entry. func TestLoginMaven_UpdatingSecondAliasPreservesFirst(t *testing.T) { home := t.TempDir() setHome(t, home) require.NoError(t, loginMaven("", "alias-one", "tok1")) require.NoError(t, loginMaven("", "alias-two", "tok2")) // alias-two's block now sits after alias-one's. Refreshing it // (a normal token-renewal call) must not disturb alias-one. require.NoError(t, loginMaven("", "alias-two", "tok2-refreshed")) got, err := os.ReadFile(settingsPath(home)) require.NoError(t, err) content := string(got) assert.Contains(t, content, wantServerBlock("alias-one", "tok1"), "alias-one must survive refreshing alias-two") assert.Contains(t, content, wantServerBlock("alias-two", "tok2-refreshed")) assert.Equal(t, 1, strings.Count(content, "alias-one")) assert.Equal(t, 1, strings.Count(content, "alias-two")) } // writeSettings puts fixture at ~/.m2/settings.xml for a home that setHome has // already pointed at. func writeSettings(t *testing.T, home, fixture string) { t.Helper() require.NoError(t, os.MkdirAll(filepath.Dir(settingsPath(home)), 0o700)) require.NoError(t, os.WriteFile(settingsPath(home), []byte(fixture), 0o600)) } // TestLoginMaven_RefusesOneLineServerBlock covers the shape that used to make // this command a silent no-op: mavenServerBlockRe matches a one-line block, but // mavenServerCloseRe needs at the start of a line, so both credential // inserts were skipped and the caller still printed a success line. Maven was // left with no credentials and nothing said so. func TestLoginMaven_RefusesOneLineServerBlock(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n \n my-alias\n \n\n" writeSettings(t, home, fixture) err := loginMaven("", "my-alias", "tok1") require.ErrorContains(t, err, "cannot edit") got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) assert.Equal(t, fixture, string(got), "a refusal must leave the file byte-for-byte intact") } // TestLoginMaven_RefusesBlockWhoseLastChildSharesTheClosingLine covers the // partial-write half of the same hole: is on a line of its own so it // was rewritten, then the insert was skipped, leaving a // with a username and no password. func TestLoginMaven_RefusesBlockWhoseLastChildSharesTheClosingLine(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n \n \n my-alias\n foo\n \n\n" writeSettings(t, home, fixture) err := loginMaven("", "my-alias", "tok1") require.ErrorContains(t, err, "cannot edit") got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) assert.Equal(t, fixture, string(got), "neither credential may be written when only one can be placed") assert.NotContains(t, string(got), "__token__") } // TestLoginMaven_SkipsCommentedOutServersSection covers the stock apache-maven // settings.xml shape: commented-out examples ahead of the live section. // Inserting before the first would put the block, and the that // finds it again, inside the comment, so every later refresh would claim the // commented block and the live section would stay empty forever. func TestLoginMaven_SkipsCommentedOutServersSection(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + " \n" + " \n" + " \n" + "\n" writeSettings(t, home, fixture) require.NoError(t, loginMaven("", "my-alias", "tok1")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) content := string(got) // The block belongs to the live section, which is the one after the comment. _, live, found := strings.Cut(content, "-->") require.True(t, found, "the comment must survive") assert.Contains(t, live, wantServerBlock("my-alias", "tok1")) assert.Contains(t, content, "example", "the commented example must be untouched") } // TestLoginMaven_SkipsCommentedOutServerBlockForSameAlias pins that a // commented-out block carrying this alias does not absorb the refresh. It used // to match, so credentials were rewritten inside the comment and the live // section never got a block. func TestLoginMaven_SkipsCommentedOutServerBlockForSameAlias(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + " \n" + " \n" + " \n" + "\n" writeSettings(t, home, fixture) require.NoError(t, loginMaven("", "my-alias", "tok1")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) content := string(got) assert.Contains(t, content, "old", "the commented block must be untouched") assert.Contains(t, content, "old-secret", "the commented block must be untouched") assert.Contains(t, content, wantServerBlock("my-alias", "tok1"), "a live block must be added") assert.Equal(t, 1, strings.Count(content, "__token__")) } // TestLoginMaven_CommentedCredentialDoesNotAbsorbTheRefresh covers the worst of // the three comment cases, because it reports success while leaving Maven on // the expiring token: a commented-out ahead of the live one used to // take the replacement. func TestLoginMaven_CommentedCredentialDoesNotAbsorbTheRefresh(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + " \n" + " \n" + " my-alias\n" + " __token__\n" + " \n" + " tok1\n" + " \n" + " \n" + "\n" writeSettings(t, home, fixture) require.NoError(t, loginMaven("", "my-alias", "tok2")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) content := string(got) assert.Contains(t, content, "", "the commented credential must be untouched") assert.Contains(t, content, " tok2\n", "the live credential must be the one rewritten") assert.NotContains(t, content, "tok1") } // TestLoginMaven_AddsSectionWhenServersOnlyExistsInAComment pins that the // "cannot edit" refusal keys off a live . A file whose only // is commented out has no real one, so the path applies, and the // old advice about putting tags on their own lines named tags the user never // wrote. func TestLoginMaven_AddsSectionWhenServersOnlyExistsInAComment(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n \n\n" writeSettings(t, home, fixture) require.NoError(t, loginMaven("", "my-alias", "tok1")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) content := string(got) assert.Contains(t, content, " \n") assert.Contains(t, content, wantServerBlock("my-alias", "tok1")) assert.Contains(t, content, "", "the comment must survive") } // TestLoginMaven_ExpandsSelfClosingServersOnCRLF pins that a CRLF file's line // separator is consumed whole. The pattern used to stop before the \r, leaving // a line holding nothing but a carriage return where had been. func TestLoginMaven_ExpandsSelfClosingServersOnCRLF(t *testing.T) { home := t.TempDir() setHome(t, home) writeSettings(t, home, "\r\n \r\n\r\n") require.NoError(t, loginMaven("", "my-alias", "tok1")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) content := string(got) assert.Contains(t, content, wantServerBlock("my-alias", "tok1")) assert.NotContains(t, content, "\n\r\n", "the line must not be left behind as a line holding only a carriage return") assert.NotContains(t, content, "") } // TestLoginMaven_TreatsEmptyFileAsAbsent covers `touch ~/.m2/settings.xml`: an // empty file has no section and no tag, so it used to // fail with advice about tags that were never there. func TestLoginMaven_TreatsEmptyFileAsAbsent(t *testing.T) { home := t.TempDir() setHome(t, home) writeSettings(t, home, "") require.NoError(t, loginMaven("", "my-alias", "tok1")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) want := "\n" + " \n" + wantServerBlock("my-alias", "tok1") + " \n" + "\n" assert.Equal(t, want, string(got)) } // TestLoginMaven_TreatsWhitespaceOnlyFileAsAbsent is the same case one step // less exact, since an interrupted editor session leaves a newline behind. func TestLoginMaven_TreatsWhitespaceOnlyFileAsAbsent(t *testing.T) { home := t.TempDir() setHome(t, home) writeSettings(t, home, "\n\n \n") require.NoError(t, loginMaven("", "my-alias", "tok1")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) assert.Contains(t, string(got), wantServerBlock("my-alias", "tok1")) } // TestLoginMaven_ProseCommentNamingServerKeepsTheLiveBlockVisible covers a // comment that names without closing it, which the stock apache-maven // settings.xml avoids only because its examples are self-closed. Skipping a // match that starts inside a comment was not enough: mavenServerBlockRe started // at the commented and ran to the live block's , so skipping // it skipped the live block too, and a second my-alias was appended. // Maven silently keeps the stale first block in that file. func TestLoginMaven_ProseCommentNamingServerKeepsTheLiveBlockVisible(t *testing.T) { home := t.TempDir() setHome(t, home) comment := " \n" fixture := "\n" + " \n" + comment + " \n" + " my-alias\n" + " __token__\n" + " tok0\n" + " \n" + " \n" + "\n" writeSettings(t, home, fixture) require.NoError(t, loginMaven("", "my-alias", "tok2")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) content := string(got) assert.Contains(t, content, comment+wantServerBlock("my-alias", "tok2"), "the block after the comment must be the refreshed one") assert.Equal(t, 1, strings.Count(content, "my-alias"), "the live block must be refreshed, not duplicated") assert.NotContains(t, content, "tok0") } // TestLoginMaven_ProseCommentNamingPasswordDoesNotDuplicateIt is the same hole // one element down, and the worse half: the commented swallowed the // live one, so the live element looked absent and a second was // inserted next to it. Duplicate children make settings.xml non-parseable, so // Maven fails on every command until the user edits the file by hand. func TestLoginMaven_ProseCommentNamingPasswordDoesNotDuplicateIt(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + " \n" + " \n" + " my-alias\n" + " __token__\n" + " \n" + " tok0\n" + " \n" + " \n" + "\n" writeSettings(t, home, fixture) require.NoError(t, loginMaven("", "my-alias", "tok2")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) content := string(got) assert.Contains(t, content, " tok2\n") assert.Equal(t, 1, strings.Count(content, ""), "a live must be rewritten, not joined by a second one") assert.Contains(t, content, "", "the comment must survive") } // TestLoginMaven_MatchesAnIDPaddedWithWhitespace pins that is compared the // way Maven reads it, which is trimmed. Requiring the exact spelling appended a // second block with the same id, and Maven keeps using the stale first one. func TestLoginMaven_MatchesAnIDPaddedWithWhitespace(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n" + " \n" + " \n" + " my-alias \n" + " __token__\n" + " tok0\n" + " \n" + " \n" + "\n" writeSettings(t, home, fixture) require.NoError(t, loginMaven("", "my-alias", "tok2")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) content := string(got) assert.Contains(t, content, " my-alias \n", "the user's spelling of the id must be left as it is") assert.Contains(t, content, " tok2\n") assert.Equal(t, 1, strings.Count(content, ""), "the existing block must be refreshed, not duplicated") } // TestLoginMaven_ReportsASettingsCloseTagItCannotUse covers a that // shares a line with another element. The error used to say the file had no // tag, which sent the user looking for a tag that is right there. func TestLoginMaven_ReportsASettingsCloseTagItCannotUse(t *testing.T) { home := t.TempDir() setHome(t, home) fixture := "\n \n" writeSettings(t, home, fixture) err := loginMaven("", "my-alias", "tok1") require.ErrorContains(t, err, "it does not start its own line") got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) assert.Equal(t, fixture, string(got), "a refusal must leave the file byte-for-byte intact") } // TestLoginMaven_IndentsPastACommentSharingTheClosingLine covers the cosmetic // side of masking comments: the mask blanks a comment ahead of on the // same line, so the captured "indentation" is as wide as the comment unless the // line's real leading whitespace is what gets used. func TestLoginMaven_IndentsPastACommentSharingTheClosingLine(t *testing.T) { home := t.TempDir() setHome(t, home) writeSettings(t, home, "\n \n \n\n") require.NoError(t, loginMaven("", "my-alias", "tok1")) got, readErr := os.ReadFile(settingsPath(home)) require.NoError(t, readErr) want := "\n" + " \n" + wantServerBlock("my-alias", "tok1") + " \n" + "\n" assert.Equal(t, want, string(got)) } func TestLoginMaven_WritesConfigFile(t *testing.T) { home := t.TempDir() setHome(t, home) path := filepath.Join(t.TempDir(), "ci", "settings.xml") require.NoError(t, loginMaven(path, "my-alias", "tok1")) got, err := os.ReadFile(path) require.NoError(t, err) assert.Contains(t, string(got), wantServerBlock("my-alias", "tok1")) _, err = os.Stat(settingsPath(home)) assert.ErrorIs(t, err, os.ErrNotExist, "nothing may be written under ~/.m2 when a path is given") }