Skip to content

Commit 67adb10

Browse files
[8.2] Add the User Profiles APIs
Co-authored-by: Seth Michael Larson <[email protected]>
1 parent 6805a89 commit 67adb10

File tree

17 files changed

+1441
-29
lines changed

17 files changed

+1441
-29
lines changed

output/schema/schema.json

Lines changed: 826 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

Lines changed: 21 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export enum GrantType {
21+
password,
22+
access_token
23+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { Dictionary } from '@spec_utils/Dictionary'
21+
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
22+
import { User } from './User'
23+
import { long } from '@_types/Numeric'
24+
import { SequenceNumber } from '@_types/common'
25+
26+
export class UserProfileHitMetadata {
27+
_primary_term: long
28+
_seq_no: SequenceNumber
29+
}
30+
31+
export class UserProfile {
32+
uid: string
33+
user: User
34+
data?: Dictionary<string, UserDefinedValue>
35+
access?: Dictionary<string, UserDefinedValue>
36+
enabled?: boolean
37+
}
38+
39+
export class UserProfileWithMetadata extends UserProfile {
40+
last_synchronized: long
41+
_doc?: UserProfileHitMetadata
42+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { RequestBase } from '@_types/Base'
21+
import { GrantType } from '@security/_types/GrantType'
22+
23+
/**
24+
* Creates or updates a user profile on behalf of another user.
25+
* @rest_spec_name security.activate_user_profile
26+
* @since 8.2.0
27+
* @stability experimental
28+
*/
29+
export interface Request extends RequestBase {
30+
body: {
31+
access_token?: string
32+
grant_type: GrantType
33+
password?: string
34+
username?: string
35+
}
36+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { UserProfileWithMetadata } from '@security/_types/UserProfile'
21+
22+
export class Response {
23+
body: UserProfileWithMetadata
24+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { RequestBase } from '@_types/Base'
21+
import { Refresh } from '@_types/common'
22+
23+
/**
24+
* Disables a user profile so it's not visible in user profile searches.
25+
* @rest_spec_name security.disable_user_profile
26+
* @since 8.2.0
27+
* @stability experimental
28+
*/
29+
export interface Request extends RequestBase {
30+
path_parts: {
31+
/**
32+
* Unique identifier for the user profile.
33+
*/
34+
uid: string
35+
}
36+
query_parameters: {
37+
/**
38+
* If 'true', Elasticsearch refreshes the affected shards to make this operation
39+
* visible to search, if 'wait_for' then wait for a refresh to make this operation
40+
* visible to search, if 'false' do nothing with refreshes.
41+
* @server_default false
42+
*/
43+
refresh?: Refresh
44+
}
45+
}

0 commit comments

Comments
 (0)