gitlab logo
GitLab v5.0.2, May 23 23

gitlab.getCurrentUser

Explore with Pulumi AI

The gitlab.getCurrentUser data source allows details of the current user (determined by token provider attribute) to be retrieved.

Upstream API: GitLab GraphQL API docs

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;

return await Deployment.RunAsync(() => 
{
    var example = GitLab.GetCurrentUser.Invoke();

});
package main

import (
	"github.com/pulumi/pulumi-gitlab/sdk/v5/go/gitlab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.GetCurrentUser(ctx, nil, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GitlabFunctions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = GitlabFunctions.getCurrentUser();

    }
}
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.get_current_user()
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const example = gitlab.getCurrentUser({});
variables:
  example:
    fn::invoke:
      Function: gitlab:getCurrentUser
      Arguments: {}

Using getCurrentUser

function getCurrentUser(opts?: InvokeOptions): Promise<GetCurrentUserResult>
def get_current_user(opts: Optional[InvokeOptions] = None) -> GetCurrentUserResult
func GetCurrentUser(ctx *Context, opts ...InvokeOption) (*GetCurrentUserResult, error)

> Note: This function is named GetCurrentUser in the Go SDK.

public static class GetCurrentUser 
{
    public static Task<GetCurrentUserResult> InvokeAsync(InvokeOptions? opts = null)
}
public static CompletableFuture<GetCurrentUserResult> getCurrentUser(InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: gitlab:index/getCurrentUser:getCurrentUser
  arguments:
    # arguments dictionary

getCurrentUser Result

The following output properties are available:

Bot bool

Indicates if the user is a bot.

GlobalId string

Global ID of the user. This is in the form of a GraphQL globally unique ID.

GlobalNamespaceId string

Personal namespace of the user. This is in the form of a GraphQL globally unique ID.

GroupCount int

Group count for the user.

Id string

ID of the user.

Name string

Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.

NamespaceId string

Personal namespace of the user.

PublicEmail string

User’s public email.

Username string

Username of the user. Unique within this instance of GitLab.

Bot bool

Indicates if the user is a bot.

GlobalId string

Global ID of the user. This is in the form of a GraphQL globally unique ID.

GlobalNamespaceId string

Personal namespace of the user. This is in the form of a GraphQL globally unique ID.

GroupCount int

Group count for the user.

Id string

ID of the user.

Name string

Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.

NamespaceId string

Personal namespace of the user.

PublicEmail string

User’s public email.

Username string

Username of the user. Unique within this instance of GitLab.

bot Boolean

Indicates if the user is a bot.

globalId String

Global ID of the user. This is in the form of a GraphQL globally unique ID.

globalNamespaceId String

Personal namespace of the user. This is in the form of a GraphQL globally unique ID.

groupCount Integer

Group count for the user.

id String

ID of the user.

name String

Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.

namespaceId String

Personal namespace of the user.

publicEmail String

User’s public email.

username String

Username of the user. Unique within this instance of GitLab.

bot boolean

Indicates if the user is a bot.

globalId string

Global ID of the user. This is in the form of a GraphQL globally unique ID.

globalNamespaceId string

Personal namespace of the user. This is in the form of a GraphQL globally unique ID.

groupCount number

Group count for the user.

id string

ID of the user.

name string

Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.

namespaceId string

Personal namespace of the user.

publicEmail string

User’s public email.

username string

Username of the user. Unique within this instance of GitLab.

bot bool

Indicates if the user is a bot.

global_id str

Global ID of the user. This is in the form of a GraphQL globally unique ID.

global_namespace_id str

Personal namespace of the user. This is in the form of a GraphQL globally unique ID.

group_count int

Group count for the user.

id str

ID of the user.

name str

Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.

namespace_id str

Personal namespace of the user.

public_email str

User’s public email.

username str

Username of the user. Unique within this instance of GitLab.

bot Boolean

Indicates if the user is a bot.

globalId String

Global ID of the user. This is in the form of a GraphQL globally unique ID.

globalNamespaceId String

Personal namespace of the user. This is in the form of a GraphQL globally unique ID.

groupCount Number

Group count for the user.

id String

ID of the user.

name String

Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.

namespaceId String

Personal namespace of the user.

publicEmail String

User’s public email.

username String

Username of the user. Unique within this instance of GitLab.

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes

This Pulumi package is based on the gitlab Terraform Provider.